• 2.3.0

      Bitbucket has, as of 5.4.0,  a better webhook integration. 

      This is especially good for the Bitbucket users that can't install unsuported plugins. The new solution is always enabled and doesn't need additional configuration.

      Explanation about this: https://confluence.atlassian.com/bitbucketserver/managing-webhooks-in-bitbucket-server-938025878.html

       

      The different payloads it has : https://confluence.atlassian.com/bitbucketserver/event-payload-938025882.html

       

      I believe there isn't a webhook api yet, and I haven't found anything yet about plans of creating it. I think we have to wait until then?

          [JENKINS-46946] Use the bitbucket server webhook api

          Erwin Oldenkamp created issue -
          Erwin Oldenkamp made changes -
          Priority Original: Minor [ 4 ] New: Major [ 3 ]

          Brian Holt added a comment -

          There is a webhooks API. See this reference.

          Brian Holt added a comment - There is a webhooks API. See this reference .
          Konrad Windszus made changes -
          Link New: This issue is related to JENKINS-33507 [ JENKINS-33507 ]

          The webhook API documentation at https://developer.atlassian.com/static/rest/bitbucket-server/5.5.0/bitbucket-rest.html#idm140236731154672 is lacking details though about the request body JSON format to create a new hook.

          Konrad Windszus added a comment - The webhook API documentation at https://developer.atlassian.com/static/rest/bitbucket-server/5.5.0/bitbucket-rest.html#idm140236731154672 is lacking details though about the request body JSON format to create a new hook.

          The documentation includes an example JSON response after successfully creating a webhook. I tried sending the same kind of JSON object in the request and that created a webhook OK. Bitbucket Server apparently ignores the "id", "createdDate", and "updatedDate" properties of the request JSON object.

          Kalle Niemitalo added a comment - The documentation includes an example JSON response after successfully creating a webhook. I tried sending the same kind of JSON object in the request and that created a webhook OK. Bitbucket Server apparently ignores the "id", "createdDate", and "updatedDate" properties of the request JSON object.

          In Jenkins, I can open the configuration page of a job, add the "Override hook management" behavior to a "Bitbucket" branch source, and change the setting to "Disable hook management". I hope this setting will work with Bitbucket Server too, so that I can configure the webhook manually and not have to grant REPO_ADMIN permission to Jenkins. However, it is not clear how I would then tell Jenkins the webhook secret with which Bitbucket Server will authenticate the payload. Or is Jenkins going to validate the HMAC at all?

          Kalle Niemitalo added a comment - In Jenkins, I can open the configuration page of a job, add the "Override hook management" behavior to a "Bitbucket" branch source, and change the setting to "Disable hook management". I hope this setting will work with Bitbucket Server too, so that I can configure the webhook manually and not have to grant REPO_ADMIN permission to Jenkins. However, it is not clear how I would then tell Jenkins the webhook secret with which Bitbucket Server will authenticate the payload. Or is Jenkins going to validate the HMAC at all?
          Kalle Niemitalo made changes -
          Link New: This issue is blocked by JENKINS-47891 [ JENKINS-47891 ]

          Konrad Windszus added a comment - - edited

          I created a branch with some changes at https://github.com/jenkinsci/bitbucket-branch-source-plugin/compare/master...kwin:bbserver-use-native-webhooks This is not complete yet as I still have to figure how to correctly fill the changes in BitbucketServerPushEvent and BitbucketServerPullRequest.

          eernie Maybe you can have a look from there, as you did the original implementation against your own plugin.

          Konrad Windszus added a comment - - edited I created a branch with some changes at https://github.com/jenkinsci/bitbucket-branch-source-plugin/compare/master...kwin:bbserver-use-native-webhooks This is not complete yet as I still have to figure how to correctly fill the changes in BitbucketServerPushEvent and BitbucketServerPullRequest. eernie Maybe you can have a look from there, as you did the original implementation against your own plugin.
          Erwin Oldenkamp made changes -
          Attachment New: active installs.gif [ 40434 ]

            twz123 Tom Wieczorek
            eernie Erwin Oldenkamp
            Votes:
            17 Vote for this issue
            Watchers:
            25 Start watching this issue

              Created:
              Updated:
              Resolved: