Yes, Bamboo can change status of tickets in JIRA. But you will need to do a little bit of magic.
First of all, you need to learn how to use CLI plugin for JIRA. It is a great tool (it is worth mentioning that it has become a winner of atlassian codegeist contest in 2010) for the purpose of automating routine JIRA-related tasks. Actually, there are few versions of this tool that allow automating almost all Atlassian tools (JIRA, Confluence, Bamboo, Crucible, Fisheye, Stash) via command line scripting. Even though it is a little bit slow, it can do pretty much everything including issue status change. Please note it could be used both as a JIRA plugin and as a standalone command line tool. You need to install standalone version of JIRA CLI plugin (here is installation guide) on the machine where your Bamboo build agent is run.
In order to fast track an issue (that is how atlassian developers call the process of changing issue statuses automatically) in JIRA, you will need to use following command:
java -jar jira-cli-3.3.0.jar --action progressIssue --issue ISSUE-123 --step WORKFLOW_TRANSITION_ID --user USERNAME --password PASSWORD --server http://yourjira.company.com
Replace template option values with your actual values. Important value is WORKFLOW_TRANSITION_ID
as long as it specifies which workflow transition will be used in order to transfer your JIRA issue into the status you actually need. In order to find WORKFLOW_TRANSITION_ID
, you need to check workflow that is used for the ISSUE-123. Usually, you are about to fast track issues that have the same issue type (for example, Bug, Enhancement, etc). Also, usually issues with the same issue type have the same workflow (for example, Bug workflow).
You need to get to the administrative section of JIRA and find that workflow. Then you need to find out ids of all transitions that lead to the status you want issue to have after your update. In your case you need to find 'Ready for QA' status and all its incoming transitions. Write down ids of those transitions and use them later in order to substitute WORKFLOW_TRANSITION_ID
value in the template.
If you have transitions with ids 51, 62 and 83, then your script will look as follows:
java -jar jira-cli-3.3.0.jar --action progressIssue --issue ISSUE-123 --step 51 --user USERNAME --password PASSWORD --server http://yourjira.company.com
java -jar jira-cli-3.3.0.jar --action progressIssue --issue ISSUE-123 --step 62 --user USERNAME --password PASSWORD --server http://yourjira.company.com
java -jar jira-cli-3.3.0.jar --action progressIssue --issue ISSUE-123 --step 83 --user USERNAME --password PASSWORD --server http://yourjira.company.com
If you need to fast track issues with other issue types and, therefore, workflows, you will need to find those workflows and find transitions that leads to 'Ready for QA' status (if it is actually used by workflow) just like you did with previous workflow.
In case you are confused with all the available command line options and their values, use JIRA CLI documentation as a command line options reference.
After you have figured out the content of the script that is going to fast track issues to the required status (in your case 'Ready for QA'), you will need to include it into the build script used by Bamboo.
Next step would be to store content of fast tracking script to the file:
Bash (build.sh):
while getopts "j:" opt; do
case $opt in
j)
java -jar jira-cli-3.3.0.jar --action progressIssue --issue $OPTARG --step 51 --user USERNAME --password PASSWORD --server http://yourjira.company.com
java -jar jira-cli-3.3.0.jar --action progressIssue --issue $OPTARG --step 62 --user USERNAME --password PASSWORD --server http://yourjira.company.com
java -jar jira-cli-3.3.0.jar --action progressIssue --issue $OPTARG --step 83 --user USERNAME --password PASSWORD --server http://yourjira.company.com
;;
\?)
echo "No issue key has been passed: -$OPTARG" >&2
;;
esac
done
Note that it uses -j
option in order to specify JIRA issue key for the script as a command line argument.
Everything else depends on what build management tool you use (Ant, Maven or just plain bash). But, in any case, you will be able to pass jira key (that bamboo gets for you from the git comment) as a command line option for the build script you use on Bamboo:
Bash:
./build.sh -j ${bamboo.issueKey}
Ant:
ant -Djirakey=${bamboo.issueKey}
Maven:
mvn -Djirakey=${bamboo.issueKey}
Last step you need is to adapt fast track code for the build management tool you use.
Ant (build.xml):
<exec executable="bash" dir=".">
<arg value="build.sh"/>
<arg value="-j"/>
<arg value="${jirakey}"/>
</exec>
For Maven it is much more complex. Use maven exec plugin for executing build.sh
from your build script.
In order to avoid writing complex build scripts, you might choose to add standalone build step on Bamboo that will be run after successful build. But in this case you will not be able to update issue status while build is still running (actually, not sure, you want to do that). Usually adding standalone build step is enough to achieve what you want. Just put ./build.sh -j ${bamboo.issueKey}
in the field 'Argument' while adding new build step on Bamboo.
NOTE: I didn't test any of those scripts because currently I do not have bamboo installed and do not have chance to experiment with fast tracking by CI server. So, be careful and make sure you understand what you are doing.
Hope my recommendations will help you to achieve what you want. Good luck!