Automation for Jira: How to prevent user from setting null value for a custom field by setting it back to original value
プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。
このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
要約
In certain situations, it is necessary to restrict users from changing the value of a custom or system field to null after a value has been assigned. This article provides guidance on how to accomplish this using Automation for Jira.
環境
- Jira Server / Data Center 8.0.0 以降のバージョン
- Automation for Jira 7.0.0 以降のバージョン
ソリューション
To prevent null values in a specific field, you can implement the following automation rule. This rule monitors changes to the field using the smart value fieldChange. It checks whether the new value is empty; if it is, the automation action will update the field, reverting it to its previous value—the value that existed before it was set to empty. This approach ensures that the field remains populated and avoids null entries.
- Use Field value changed as the trigger for the automation rule and select the custom field you wish to prevent null values
- Select New Condition component and use Advance compare condition. Use the smart value {{fieldChange.toString}} as the First value and leave Second value blank, condition should be set as equals.
- Select New Action component and use Edit Issue. Choose the custom field and use the smart value {{fieldChange.fromString}}