Bamboo deployment

Hi, I’m try to automated my release build process through the Bamboo. Is there is a way to stop the trigger when there is unresolved JIRA issues related to the build version during the build stage or deployment stage?

1 answer

It seems like you could run a check using REST and if the returned content contains the string "unresolved" (or whatever string is in the REST result that indicates the state of the issue is unresolved) then set exit=1.That would give you the effect you are looking for. The build would return red and failed and would go no further.

You'd first have to get the list of jira issues associated with the build.

get the states of the issues associated with the build.

if the state = unresolved set exit 0.

I'm not sure exactly how hard that would be to do. You'd probably want to also print some kind of information in the log file indicating why the build failed i.e. "Issue PRJ-12345 is in the state UNRESOLVED" or something like that to make it evident why the build was failed.

I would put this up in the initial part of the build before you went to all the trouble (time) to checkout the repository for the build.

Look around in "answers" for the string REST for some examples and links to the REST documentation. Someone has probably done this before but since no one else has responded I thought I'd give my two cents.

http://yourhost/bamboo/rest/api/latest/result/PRJ-PLAN-3?expand=jiraIssues

That should get you the list of jira issues that you'll then have to parse for the strings that are valid and if any string = open, inprogress, print "failed: code not ready to deploy or something like that" set exit=1 else print "all systems nominal" set exit =0 (continue your build or deployment).

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,581 views 0 6
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you