Automation for Jira - How to create a rule that when a Date field A is changed, edits Date field B and adds to/substracts from it the days difference by which field A was changed
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Fisheye および Crucible は除く
要約
This article explains how to create a rule that automatically shifts a date field with the number of days which another date field was modified by.
例:
We have two Date type fields that are initially set as:
Field A: 01/Jul/23
Field B: 20/Jul/23
When the Field A is changed to 08/Jul/23, we want automation to shift Field B with 7 days and set it to 27/Jul/23.
環境
- Jira Server / Data Center 8.0.0 以降のバージョン
- Automation for Jira 7.0.0 以降のバージョン
ソリューション
Create an Automation rule as below:
- Add "Field Value Changed" trigger for Field A.
- Add "Edit Issue" action and set Field B with the following expression:
{{issue.Field B.plusDays(fieldchange.from.toDate.diff(fieldchange.to.toDate).days)}}
自動化ルールは次のスクリーンショットのようになります。