Jira Automation with Bitbucket
In the sprint based development life cycle, developers are reluctant to go the Jira tickets and do the transitions in the sprint board. Here it comes the Jira Automation which allows developers to do their job in the Bitbucket (or any git tools) and automate the transition in the sprint board.
Prerequisites
- Integrate Jira with the Bitbucket (See more for how to do the integration https://www.atlassian.com/software/jira/bitbucket-integration)
Use Case
Assume that we are having a sprint board as follows.
Ideally what we are going to automate is all the tickets in the DEVELOPMENT DONE (CODE REVIEW) column automatically transit to READY FOR QA column once the deployment is done in the Bitbucket pipeline
Let’s Begin..
- Go to Project Settings → Automation → Create rule
- First you need to figure which trigger is best suite for your requirement. You can find lots of triggering events to start the execution of automation rules. In our use case it’s going to be Deployment successful trigger.
- You can select environment type according to pipeline such as Staging, Production
- Then we need to filter Jira tickets which are in the current active sprint, Add Component → New action → Lookup issues → Add JQL script as “sprint IN openSprints()”.
You can find more JQL syntax in this URL (https://3kllhk1ibq34qk6sp3bhtox1-wpengine.netdna-ssl.com/wp-content/uploads/2017/12/atlassian-jql-cheat-sheet-2.pdf) - Add Component → New action → Transition issue → Set Destination status to QA (whatever status you want to transit).
- Finally you can Publish rule. You can enable disable rules from the Automation rules list.
Although you create the automation rule, in order to trigger this rule you need to make sure few things.
- Let’s take Figure 3 as a example, we have Task 11 in the TO DO column. When developer move the ticket into the IN PROGRESS, need to make sure that issue branch is created in the Bitbucket with issue key id. Because Jira and Bitbucket sync each other with Jira ticket issue id. Best practice is to create the development branch from the Jira ticket itself as shown in the below Figure 3.
2. Once you create the branch as above, you can see all the commits, merges, pull requests, deployments etc, through the Jira ticket.
3. Finally, once you run the pipeline from the Bitbucket, it will trigger the automation rule in Jira