Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Can I change build status and add label post build using rest api?

I want to be able to change the build status and add a label after a build has finished. We have integration tests that get run and if they fail I want to be able to modify the build accordingly. How can I do this with the rest api?

1 answer

1 accepted

0 votes
Answer accepted

Hi @schow-lmi3d

To create the label you could use a call like:

curl -X POST --user <USER>:<PASSWD> -H "Content-Type: application/json" -d '{"name":"new-label"}' <BAMBOO_URL>/rest/api/latest/result/<BUILD-KEY>/label

Regarding the change of build status. Are you trying to start, stop, rerun builds?

What would be the change in status that you mentioned?

We have integration tests that run on a separate plan. We want the integration to change the state of build plan if the integration plan fails. I want to know if there is a REST API to alter the build plan to fail.

We can't change the status of a build unless we run it again and it fails. Without knowing your environment I would risk saying that your integration test should be part of the build plan you want to change the status. This would make this plan fail when the integration test fails. 

Does that make sense?


Theres a few reasons why I didn't add integration tests as another stage in the plan. Thanks for the information.

Like Daniel Santos likes this

Maybe running them as a manual stage?
That would allow you to update a green build (green, but which still have stages to run) to a failed one in case that stage fails. Maybe your integration tests will take a lot to run and you don't want them to run every time... I'm just trying to provide you with a suggestion that may help you moving forward. 

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo Data Center - Early Access Program

G’day Bamboo customers, The wait is almost over! We are in the final stages of work on the first release of Bamboo Data Center, our self-managed enterprise offering of Bamboo. This Data Center offe...

992 views 0 16
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