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

Bamboo deployment

Dylan September 3, 2013

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

0 votes
Gretchen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 29, 2013

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.

Gretchen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 29, 2013

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
TAGS
AUG Leaders

Atlassian Community Events