Transition Jira Issue when Bitbucket PR is approved
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
There are built-in triggers in Jira automation to capture events when PR is merged/created/declined. However, there is no built-in trigger to capture Pull request Approved yet (FR: JRACLOUD-81389 - DevOps Automation: Trigger for "Pull Request Approved" or changes requested in automations). To achieve the same we can use a combination of Bitbucket outgoing webhook and Jira Automation for JIRA.
Environment
Jira Cloud
Bitbucket
Solution
Only pre-requisite of this solution is, the PR title should always have Issue key so that we extract that data using automation.
Jira Automation configuration :
Here is a screenshot of the automation that we need:
Explanation:
Trigger : Incoming webhook
Log action : To verify what is the result we receive when event is received from webhook and processed by regex
1
{{webhookData.pullrequest.title.match("(\b[A-Z]+-\d+\b)")}}
Branch Rule of the type JQL and in JQL add :
1
key = {{webhookData.pullrequest.title.match("(\b[A-Z]+-\d+\b)")}}
Transition to desired Status
Bitbucket Configuration :
Go to Bitbucket Repository > Repository Settings > Webhook
Create a Webhook and paste the link from "Incoming webhook" in Jira automation.
In webhook Trigger choose PR - Approved.

Whenever the PR is approved in Bitbucket, a webhook response is sent out and captured by automation. Automation then will extract issue from PR Title and transition respective issue.
Was this helpful?