Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Required builds merge check does not work when integrated with Teamcity.

Loh
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 11, 2025

I added "Commit status publisher" build feature to Teamcity build configuration and I see successful builds on the "builds" tab in pullrequest.

However, if I set some required builds for pull requests, bitbucket shows issue that prevents merging PR "Successful build of {build id} for the latest commit is required before this pull request can be merged."

What build ID should I specify when integrating with Teamcity? I have set "Build configuration ID" option from the Teamcity.
I got the same build keys when running the command:

curl -u {user}:{pass} https://{bitbucket_server}/rest/build-status/1.0/commits/{commit_hash}

1 answer

0 votes
Aman Shrivastava
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 11, 2025

Hi @Loh 


The reason that required builds merge check is not automatically suggesting the key of the builds is that you may be using a plugin/feature in Teamcity that sends build details via the old endpoint. Not all plugins use the new endpoint to update the build status in Bitbucket, which means the necessary details such as parent, ref for this feature to work are not sent by those plugins. Consequently, the feature does not function in these situations.

Old Endpoint(deprecated): /rest/build-status/1.0/commits/<commit-hash>/builds
New Endpoint : /rest/api/latest/projects/<projectKey>/repos/<repositorySlug>/commits/<commitId>/builds

We have indicated in the Required Builds Merge Check article that this feature only functions with Bamboo 7.1+ or the Bitbucket Integration Plugin version 2.0.0+ the reason is that these tools use the newer endpoint. However, it can also work with any third-party plugin that uses the new endpoint.

I want to clarify that the build key you obtain from the endpoint "https://{bitbucket_server}/rest/build-status/1.0/commits/{commit_hash}" does not correspond directly to the key that Bitbucket shows on the required builds page. Instead, the build key displayed by Bitbucket is derived from the parent field in the build result response. Although they are often the same, they can differ. I can provide an example from my local setup to demonstrate the difference.

Screenshot 2025-07-12 at 10.40.37 AM.png

Ensure that your CI/CD system uses the newer endpoint so it populates all the relevant data and whatever value it is sending in the parent field is what you can define in required builds page. 

Regards,
Aman

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events