Transition Jira Issue when Bitbucket PR is approved

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問


Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.

要約

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 - Getting issue details... STATUS ). To achieve the same we can use a combination of Bitbucket outgoing webhook and Jira Automation for JIRA.

環境

  • Jira Cloud
  • Bitbucket

ソリューション

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:
  • 説明:
    • Trigger : Incoming webhook 
    • Log action : To verify what is the result we receive when event is received from webhook and processed by regex 

      {{webhookData.pullrequest.title.match("(\b[A-Z]+-\d+\b)")}} 
    • Branch Rule of the type JQL and in JQL add : 

      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.




最終更新日: 2024 年 10 月 1 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.