Using Atlassian Bitbucket v4.9.0.
My enterprise has a large installation of Bitbucket server. We can define webhooks and "Pull Request Notifications" that allow for some automation upon changes to the repository. However, there are a couple things that just don't do anything. The nature of how these features work, combined with our limited access to the support organization for this platform, make it awkward to diagnose why these features aren't working. It also may require debugging issues with Jenkins, another platform that I don't control (even though my support access for Jenkins is better).
For instance, I use the "Http Request Post Receive Hook" with some success, but its scope is limited, as it only works for "push" changes, and not for merges (most of our work is done with pull request merges).
We also use the "Pull Request Notification" feature, that fires when a pull request is created, and spawns a build of the pull request branch.
However, it seems like the "Pull Request Notification" feature only works for some of the "Trigger" events that are available in the interface. Our PRN that fires when a PR is created is looking at OPENED, REOPENED, RESCOPED_FROM, and UPDATED trigger events. I've tried to create additional PRNs in the same project checking for the COMMENTED and MERGED triggers, but it didn't appear that these events ever fired. I would have used these events to provide better automation, but they just don't do anything.
We also have the "Bitbucket Server Webhook to Jenkins" webhook. This isn't as flexible as the HRPRH in terms of what we can fire when the hook fires, but it does appear that it should fire on pull request merges. Unfortunately, this is another feature that just doesn't appear to do anything. It never seems to fire on merges.
I've managed to get builds to spawn on merges, but not with any help from BitBucket. I had to set my Jenkins job to do SCM polling in order for this to work. Unfortunately, using SCM polling is discouraged in our organization (I set it run somewhat rarely to mitigate that somewhat).
You can trigger builds with "Bitbucket Server Webhook to Jenkins" each time you update a branch. So, you just have to trigger hook on the destination branch of your pull request, and that allow you to trigger a build/jenkins job each time a pull request is merged in the specified branch. And if you specify "All branches" of your repo, I guess it will do the job.
I hope it will help,
No, that doesn't really help. I've never actually gotten the BSWtJ to work. I've also felt that even the design of it is not very good, as it doesn't give me very good control. I simply want something like the Pull Request Notification, so I can specify the events to fire on, and the URL to fire as a result of the event.
Atlassian Summit is an excellent opportunity for in-person support, training, and networking.Learn more
Hello Community! My name is Claire Maynard, and I’m a Product Marketing Manager on the Bitbucket team. I’m interested in hearing what advice or tips you have for new users getting started on ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs