Automation for Jira - How to automatically close an Initiative issue once all its Epics are closed
プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。
このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
要約
The purpose of this article is to provide a way to configure an automation rule that will automatically close an Initiative (or any other type of parent issue), once all its child issues (such as Epics) are closed.
For this solution:
- We will assume that the Initiative issue and its child Epic issues are considered as closed when they are in the Status DONE
- We will also assume that the parent/child relationship is configured as below in the Hierarchy Levels page that comes with the application Advanced Roadmaps For Jira:
- The hierarchy levels are configured so that the Initiative issue type is a parent of the Epic issue type:
- With such hierarchy level configuration, we will have the Parent/Child relationship described in the examples below:
- The issue SCRUM-29 is a parent issue of the 2 Epics SCRUM-30 and SCRUM-31 (as shown in the Child Issues panel):
- The issue SCRUM-30 (and SCRUM-31) child issues of the issue SCRUM-29 (as indicated in the Parent Link field):
- The issue SCRUM-29 is a parent issue of the 2 Epics SCRUM-30 and SCRUM-31 (as shown in the Child Issues panel):
- The hierarchy levels are configured so that the Initiative issue type is a parent of the Epic issue type:
If you are using different parent/child relationship in the Hierarchy Levels configuration with different issue types, it will be necessary to slightly adjust the solution provided in this KB article, based on your own configuration. Additionally, if you are using a different status than DONE to indicate that an issue is closed, you will need to change the automation rule slightly to reflect it.
環境
- Jira Software Server/Data Center on any version from 8.0.0
- Advanced Roadmaps For Jira on any version
- Automation for Jira バージョン 7.4.0 以降
ソリューション
最初のステップ
Before configuring the automation rule, you need to first identify the ID of the Parent Link custom field, since this ID will be different depending on the Jira environment:
- Go to ⚙ > Issues > Custom Fields
- Search for the Parent Link custom field, and click on ... > View
- URL から ID を取得します。これは、自動化ルールを設定するために必要なカスタム フィールド ID です。
Rule Configuration
The automation rule will be configured like this:
New Trigger: Issue transitioned
- From status: leave blank
- To status: Done
Make sure to change the status to the one used in the workflow when an issue is closed (for example: Closed, Resolved, etc...)
新しい条件: 課題フィールドの条件
- フィールド: 課題タイプ
- 条件: イコール
- 値: エピック
ブランチ ルール / 関連する課題
Type of related issues: JQL
key in parentIssuesOf("{{triggerIssue.key}}")
- Untick the option Only include issues that have changed since the last time this rule executed
- Rule restricted to projects: <Your project name here>
ブランチ:
New Condition: Issue Field Condition
- Status: Status
- Condition: Does not equal
- Value: Done
Make sure to change the status to the one used in the workflow when an issue is closed (for example: Closed, Resolved, etc...)
- プロジェクトに限定されたルール: <ここに自分のプロジェクト名を入力>
New Related issues condition
- Related Issues: JQL Issues
Related issues JQL: (Replace XXXXX with the Custom Field ID of the Parent Link field, based on the preliminary steps)
"Parent Link" = {{triggerIssue.customfield_XXXXX}}
Condition: "All match specified JQL"
Matching JQL: (change the status to the one indicating that an issue is closed)
status = Done
New Action: Transition issue
- Transition the issue by: Selecting the destination status
- Destination status: Done
Make sure to change the status to the one used in the workflow when an Epic/Initiative is closed (for example: Closed, Resolved, etc...)
自動化ルールは次のようになります。