We are switching off article comments on this website. Read about the upcoming changes to Atlassian Documentation.
You can configure a workflow in JIRA, so that the workflow is actioned when a build completes successfully. For example, you can configure a workflow to automatically progress an issue from 'Building' to 'Resolved' status. You could also configure the same workflow to progress an issue from 'Building' to 'Build Broken' status if a build related to that issue fails. A build is related to an issue if the build involves a commit that had the JIRA issue key added to commit message.
A Builds Workflow exists in JIRA and it incorporates the common statuses and transitions (see the Understanding the 'Builds Workflow' section below).
Diagram: The default Builds Workflow
Wait for Build
The 'Wait for Build', 'Build Passed' and 'Build Failed' transitions are Bamboo-specific transitions:
#wait-for-build. Note, you must manually enter the commit command in your commit message to trigger the transition, as described in Using smart commits.
The following instructions describe how to create a workflow scheme that uses the 'Builds Workflow', and then associate the workflow scheme with a project. If you want to add the 'Builds Workflow' to an existing workflow scheme, ignore steps 4-6 below and assign the workflow to your existing workflow scheme instead.
Go to the 'Project Summary' page.
Keyboard shortcut: g + g + start typing 'projects'.
Click Workflows on the left of the 'Project Summary' page (you can also click the More link in the 'Workflows' section in the middle of the screen). The 'Workflows' page is displayed, indicating the current workflow scheme used by the project.
Click Switch Scheme to display the 'Associate Workflow Scheme to Project' page.
Issues (of the issue types specified in your workflow scheme) will now use the 'Builds Workflow'. If you add the issue key of an issue to the commit message when committing, the issue will be automatically transitioned along the workflow when the build starts/succeeds/fails.
You cannot modify the 'Builds Workflow' itself because it is non-editable. However, you can copy it and edit the copy if the original 'Builds Workflow' doesn't suit the needs of your project. You can then activate the new (copied) workflow by adding it to a workflow scheme and then associating that scheme with your projects.
If modifying a copy of the 'Builds Workflow' is not feasible for your projects, it is possible to manually modify your existing workflow to include the Bamboo transitions. It is recommended that you avoid doing so unless you have a good understanding of JIRA workflows.
To integrate build transitions into your existing custom workflow, edit your workflow and configure appropriate issue statuses and issue transitions as described below.
We recommend that you set up issue statuses for your workflow to indicate when a build related to an issue is building or the build is broken (e.g. 'Building', 'Build Broken'). There is no technical restriction preventing you from incorporating Bamboo-specific build transitions into a JIRA workflow without these intermediate states, however, in practice it will cause problems.
For example, a developer may work on an issue, and commit several times over the course of a few days for that issue.
Even if earlier commits cause the build to pass, the developer may not have finished working on the issue and will need to commit more code without successful builds resolving the issue. Hence, an intermediate state (e.g. 'Building') is required which a developer will only transition the issue into (i.e. using the
#build commit command), if they want the issue to be resolved from that particular build.
Automatic issue transitioning via builds is controlled by both commit commands and Bamboo-specific transition properties in JIRA, as described below:
#wait-for-buildcommit command in their commit messages.
Bamboo-specific transition properties— The Bamboo-specific transition properties on the transitions that you want to be triggered when a Bamboo build passes or fails. The following properties are supported:
A transition with this property will be triggered when a build for this issue passes, and the transition is available to the issue in its current state.
A transition with this property will be triggered when a build for this issue fails, and the transition is available to the issue in its current state.
any valid resolution, e.g. 'Fixed'
The issue resolution will be set as specified by this property, if the transition with this property is triggered by a build.
Please note, you cannot set up common transition properties in JIRA. You will need to manually re-enter the transition property on each transition that you want it added to.