Jira Automation: Create two issues and link them together within one automation rule

お困りですか?

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

コミュニティに質問

プラットフォームについて: Cloud のみ - この記事は クラウド プラットフォームのアトラシアン製品に適用されます。

   

要約

The use-case in this article is to create an automation rule where by a manual trigger from issue A in project 1, we create a new issue B in project 1 and then another new issue C in project 2, we want to link issue B to issue C. This article explains the automation rule steps required to achieve this.

環境

Jira Cloud

ソリューション

To achieve your goal, you can follow these steps:

  • Trigger: Start with the manual trigger as you have already set up.
  • Create Issue B: Use the "Create issue" action to create issue B in Project 1. Ensure you fill out all required fields based on your project's configuration.
  • Create Issue C: Next, use another "Create issue" action to create issue C in Project 2. Again, make sure all required fields are filled.
  • Store Issue Keys: After creating each issue, use the "Edit issue" action to store the issue key of the newly created issue in a custom field or use the "Log action" to capture the issue key in the audit log for reference. This step is crucial for linking.
  • Link Issues: Finally, to link issue B and C, you might need to use a workaround since direct linking seems to pose challenges. One approach is to use a webhook to call Jira's REST API to create the link between the two issues. You will need the issue keys or IDs from the previous steps.
  • Webhook Setup: Configure a webhook in your automation rule with the following settings:
      • Method: POST
      • URL: Constructed based on Jira's REST API endpoint for issue linking. Typically, it looks like https://yourdomain.atlassian.net/rest/api/3/issueLink, replacing yourdomain with your actual domain.
      • Headers: Include content-type as application/json and authorization as needed.
      • Body: Use the JSON format to specify the link type and the issue keys/IDs for issues B and C. For example:
{
  "type": {
    "name": "Your Link Type"
  },
  "inwardIssue": {
    "key": "IssueBKey"
  },
  "outwardIssue": {
    "key": "IssueCKey"
  },
  "comment": {
    "body": "Linking Issue B and C",
    "visibility": {
      "type": "role",
      "value": "Administrators"
    }
  }
} 

Please Note: The use of webhooks and the REST API requires some technical knowledge and setup, including authentication handling. Ensure you have the necessary permissions and consult your Jira administrator if needed. Kindly follow the documentation for issueLink REST API: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-links/#api-group-issue-links



最終更新日 2024 年 9 月 18 日

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

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