Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


How to overwrite bitbucket notification status for pull requests

I have a webhook  that will trigger Jenkins build when there is a new or updated pull requests for the repos.

It will trigger the bitbucket notification to show the build status.

However, when the PR has multiple updates, it will trigger multiple builds that are tied to the PR.  This is a problem as if any of the builds fails or never completes for a reason, the PR is stuck as there is a branch restriction set:

"Check the last commit for at least 1 successful build, no failed builds, and no in progress builds"


Screenshot 2023-09-20 at 11.10.00 AM.png

4 builds were successful after the 1st build got stuck in a never completed state.  This prevented the PR from being merged


Screenshot 2023-09-20 at 11.25.57 AM.png

This PR has 6 builds that were unsuccessful, but the last one is successful.  However, since it doesn't pass the PR requirements for merging:

"Check the last commit for at least 1 successful build, no failed builds, and no in progress builds"

It is not allowed to merge.


I am using the bitbucketStatusNotify function, passing in buildState, reposSlug, and commitID.


bitbucketStatusNotify(buildState: "SUCCESS", repoSlug: "my-repos", commitId: "xyzzy")


Is there a way to cancel previous build states and only have the latest one tied to the PR?




2 answers

1 accepted

1 vote
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 22, 2023

Hi Jimmy,

You can get info about the commit statuses (including their key) of a certain commit with the following API endpoint:

Example call:

curl -u username:app-password --request GET \
--url '' \
--header 'Accept: application/json'

You can then use the following API endpoint to update a certain status:

Example call:

curl -u username:app-password --request PUT \
--url '' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"state": "SUCCESSFUL"

You can see all available values for state in the last link I shared if you select + Show child properties for Commit Status > expand the state property.

Please feel free to let me know if you have any questions!

Kind regards,

Awesome!  Thank you very much!

I found there is a buildKey field that is unique for the link.


Is there a way to find the buildKey value for previous builds?  Knowing this value, I can change the build state of the existing builds linked to the PR.

Suggest an answer

Log in or Sign up to answer
Site Admin
AUG Leaders

Atlassian Community Events