I am attempting to configure the required builds merge check on Bitbucket Server to meet the following requirements:
- Prevent merging PRs until one specific Jenkins job succeeds on the latest commit of the PR.
- Note: this requirement could be relaxed to "until any Jenkins job succeeds" instead of requiring a specific job to pass, but it would be ideal to require a specific job.
- Do not prevent merging PRs if any other Jenkins job(s) fail on the same commit.
I was originally using the minimum successful builds merge check, but that does not meet requirement #2 because it prevents merging PRs if any failed builds appear (even if there is also 1 successful build).
The required builds merge check configuration is not working as I expected. It seems to fail to recognize a successful build regardless of what build key I specify.
I set up a simplified test to confirm what I was seeing with these steps:
- Create a new repo to test
- Make an initial commit on the "main" branch
- Create a branch "test" and make a single commit on the "test" branch
- The commit ID was 7eceb4d213a211c86499e708a05efae644a867e3
- Open a PR with source branch "test" and target branch "main"
- Confirmed the PR was ready to merge (no merge check issues)
- Configure a required build for key "testKey":

- Confirmed the PR merge is blocked due to missing required build:

- Add a successful build to the latest commit via the REST API:
❌ The PR merge was still blocked due to missing required build:

- My expectation was that the required build merge check would pass after posting the successful build result with key "testKey".
- Confirmed the build with key "testKey" is listed as expected via the REST API:
What is missing from this test to allow the required builds merge check to pass? I'm hoping that a resolution to this simple example will help me find the issue when attempting similar config on my real repo.