Automation for Jira - Writing a rule that clones the Epics linked to a Feature (and their stories and sub-tasks) when the Feature is cloned

プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。

このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。

*Fisheye および Crucible は除く

要約

The Clone Issues action that comes with Automation For Jira has some limitation. For example, this action does not have the option to clone child issues of a Feature issue when this Feature issue is cloned, and when the parent/child relationship is using the Parent Link field from Advanced Roadmaps For Jira (via the hierarchy levels configuration).

This limitation is tracked in the feature request JIRAAUTOSERVER-741 - Add the ability to clone sub-tasks and linked issues when cloning a Jira issue Gathering Interest

The purpose of this knowledge article is to provide an example of automation rule that will automatically clone the child issues (Epic Issues) of a Feature issue, along with the Stories that are part of these Epics, and the Sub-tasks of these Stories.

環境

  • Jira Server / Data Center 8.0.0 以降のバージョン
  • Automation for Jira 7.4.0 以降のバージョン

ソリューション

For our solution, we will assume that:

  • There are 4 issues types ranked with the order below in the hierarchy levels configuration (via the page ⚙ > Manage Apps > Hierarchy Configuration):
    • 機能
    • エピック
    • ストーリー
    • Sub-Task
  • Epics are linked to the Feature type issues using the Parent Link field
  • Stories are linked to Epics using the Epic Link field
  • Sub-Tasks are created from Stories via the More > Create Sub-task function

Preliminary step

This step consists in creating a new type of issue link, that will be used by the 2 automation rules:

  • Log in as a Jira Admin user
  • Go to ⚙ > Issues > Issue Linking
  • Create a new type of link, using the parameters below:
    • Name: Cloners (via rule)
    • Outward Link Description: clones (via rule)
    • Inward Link Description: is cloned (via rule) by
  • After the link is created, it should appear as illustrated in the screenshot below:

Configuration of Automation Rule 1

新規トリガー: 課題がリンクされました

  • Link Types: Cloners

新しい条件: 課題フィールドの条件

  • First Value: Issue Type
  • 条件: イコール
  • Second Value: Feature

ブランチ ルール / 関連する課題

  • Type of related issues: JQL
  • JQL:

    "Parent Link" = {{destinationIssue}}
  • Rule restricted to projects: <Your project name here>
  • (warning) Make sure to untick the option Only include issues that have changed since the last time this rule executed

ブランチ:

新しいアクション: 課題の複製

  • Project: Same project
  • Issue Type: Same issue Type
  • Summary:

    {{issue.summary}}
  • Additional fields: copy the JSON payload below in this section:

    {
       "fields":{
          "Parent Link":"{{triggerIssue.key}}"
       }
    }

New Action: Link Issues

  • This issue: "is cloned (via rule) by"
  • Issue: "Most recently created issue"


Screenshot showing the entire automation rule


Configuration of Automation Rule 2

(warning) For this rule, make sure to tick the option Allow rule trigger in the Rule Details page, in order to allow the 1st rule to trigger this 2nd rule, as illustrated below:


新規トリガー: 課題がリンクされました

  • Link Types: Cloners (via rule)

新しい条件: 課題フィールドの条件

  • First Value: Issue Type
  • 条件: イコール
  • Second Value: Epic

ブランチ ルール / 関連する課題

  • Type of related issues: JQL
  • JQL:

    "Epic Link" = {{destinationIssue}}
  • Rule restricted to projects: <Your project name here>
  • (warning) Make sure to untick the option Only include issues that have changed since the last time this rule executed

ブランチ:

新しいアクション: 課題の複製

  • Project: Same project
  • Issue Type: Same issue Type
  • Summary:

    {{issue.summary}}
  • Choose fields to set: Epic Link > Trigger Issue

New Action: Link Issues

  • This issue: "is cloned (via rule) by"
  • Issue: "Most recently created issue"


Screenshot showing the entire automation rule

Configuration of Automation Rule 3

(warning) For this rule, make sure to tick the option Allow rule trigger in the Rule Details page, in order to allow the 1st rule to trigger this 2nd rule, as illustrated below:

新規トリガー: 課題がリンクされました

  • Link Types: Cloners (via rule)

新しい条件: 課題フィールドの条件

  • First Value: Issue Type
  • 条件: イコール
  • Second Value: Story

ブランチ ルール / 関連する課題

  • Type of related issues: JQL
  • JQL:

    parent = {{destinationIssue}}
  • Rule restricted to projects: <Your project name here>
  • (warning) Make sure to untick the option Only include issues that have changed since the last time this rule executed

ブランチ:

新しいアクション: 課題の複製

  • Project: Same project
  • Issue Type: Sub-task
  • Parent issue: "Trigger Issue"
  • Summary:

    {{issue.summary}}

Screenshot showing the entire automation rule



最終更新日 2024 年 9 月 2 日

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

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