Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Required build checks with build statuses published from TeamCity


We've been testing the new required builds functionality and found out that it seemingly doesn't work out of the box in Bitbucket Data Center for build statuses published from TeamCity's Commit Status Publisher build feature.

To configure the required build check in Bitbucket, a user is asked for a build key. We assumed that this is the value that is passed in the "key" field when commit statuses are published to Bitbucket. Yet it is seemingly not the case. At least the add required build form doesn't find any such keys (despite some statuses already published to various commits in our test repo) and if they key is added manually, Bitbucket claims that the merge operation is not allowed, even if a success status is published to the top commit in the respective branch. 

Could it be the case that some add-on on Bitbucket Data Center side is required? Or are these different kind of keys?

1 answer

0 votes

The build result API for a certain commit as per REST API spec [1] can have the following payload:

    "key": "TEST-REP123",
    "state": "SUCCESSFUL",
    "url": "https://bamboo.url/browse/TEST-REP1-3",
    "buildNumber": "3",

The required build form lets you configure a merge-check based on successful build results for

  • a specific target branch (or pattern)
  • only consider build results with a certain 'key'

At runtime the build result will be recorded by Bitbucket and if there is a pull request with a source-ref hash identical to the the {commitId} and a matching build key the build result will be considered when checking if the PR can be merged, or should be blocked because of a failing build.

We at Izymes have made an add-on called Workzone that lets you specify the number of successful builds (usually 1) for a protected target branch and also triggers an automatic merge if the build was successful. We have found that for most teams a successful build is the last step in their PR merge process, and it's easy to automate. Trigger build, build pass, automatic merge, done.

I hope this helps your integration. Best, Ulrich

Izymes - Remove boring from work


... forgot to mention, Workzone does not require a 'build key' in its configuration for build result merge-checks and auto-merge.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,231 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you