Automation For Jira - How to count the total number of linked issues and copy it into a number field
プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。
このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
要約
The purpose of this article is to explain how to write an automation rule that will count the total number of issues linked to a Jira issue and copy the result into a number type field.
環境
- Jira Data Center Only
- Applicable Jira / A4J (Automation for Jira) versions which include the Lookup Issues action:
- Jira 9.11.0 and any higher version (this Jira version ships with A4J 9.0.1)
- OR Jira 8.20.0 and any higher version, in combination with A4J 9.0.1
ソリューション
Rule suggestion
The rule can be configured as follows:
- Add the trigger of your choice, which can be anything you like:
- 課題が更新されました
- Field vale changed
- Manual Trigger
- Etc...
- Add a Lookup issues action:
Insert the expression below in the JQL field:
issue in linkedIssues({{triggerIssue.key}})
- Add an Edit issue action:
In the Choose field to set menu, select the name of the Number Field that needs to be updated with the number of linked issues, and paste the expression below:
{{lookupIssues.size}}
Screenshot showing the rule
Example of rule execution
The screenshot below shows an example of Jira issue against which the rule was executed:
Note: even though the issue SCRUM-33 has 4 links, since 2 of these links point to the same issue SCRUM-34, the total number of linked issues with be 3