Include URL of repository and/or commit in WebHook data

Issue #868 resolved
DavidFernandez created an issue

I am using the Webhook plugin and am trying to reconstruct the repository and commit URLs from the JSON data posted to my configured server, but I appear to be lacking some URL components. What I'm trying to do is construct a message from the Webhook post that includes a link to both the changed repository and the specific commit (within SCM-Manager).

Specifically, I'd like to make use of paths like:;AJPug8GQD2;null;null (which takes me to an SCM-Manager tab for a particular repository), and;AJPug8GQD2;18;commit (which takes me to an SCM-Manager tab for a particular commit (commit 18 in this case)).

What I seem to be lacking is the hash-like ID/code for the repository (in this case AJPug8GQD2).

It would be much appreciated if either this hash could be included as a Webhook field, or better, if those two URLs could be included in their full form. So far, I'm attempting to reconstruct the URL from a known base URL, the repository.type and fields (added to the Url Pattern), though it would be much better if the complete URLs were included as fields in the JSON data.

I'm currently using SCM-Manager v1.48 (via Docker) and the scm-webhook-plugin v1.7.

Thanks in advance.

Comments (4)

  1. DavidFernandez reporter

    Thank-you for the rapid response.

    I had looked through the documentation (both on the Webhook itself and also on the Repository and Changeset classes), but I had (incorrectly) assumed that the field I wanted was the hash code, which doesn't have a getXXX() method (but is retrievable via hashCode()), so I assumed what I needed was inaccessible.

    I suppose this comes down to me not understanding what all the repository/fields actually represent (and where else they are used). Thanks for providing clarity on that.

  2. Log in to comment