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?
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).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.