Unable to add Jenkins Build key in Required builds merge check when using Jenkins Bitbucket Server / Data Center integration plugin
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Even though commits show successful builds, the Jenkins build key does not show up in the drop down when trying to configure Required Build merge check while using the Bitbucket Server Integration plugin.
Environment
Bitbucket Data Center and Server 7.14 +
Diagnosis
Jenkins is integrated with Bitbucket using the Bitbucket Server Integration plugin.
The Build section inside the Bitbucket Repository shows the Jenkins build running successfully.
However when you try to add the Required Build merge check for the Repository it does not list the build key in the dropdown.
When trying to check the Build key using the REST API $BITBUCKET_URL/rest/build-status/1.0/commits/{commitId} the key shows up as some numbers instead of build name/path configured in Jenkins.
Cause
This is caused by older version of the Bitbucket Server Integration plugin.
Solution
Upgrade the plugin to the latest version.
Once the plugin is updated to the latest version, try pushing a new commit to trigger a new JOB. Now you can list the Build key in the dropdown when trying to configure Required Builds merge check in the Repository.
Also the Build status API response for the commit will have the right Build key instead of numbers.
Was this helpful?