Automation for Jira cannot publish an Automation rule with an error: "additional fields contains invalid field(s) in ‘update’ or ‘fields’ section: <Field_Name>"
プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。
このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
要約
When configuring an automation rule in Jira, and trying to publish it - the following error may appear under Actions such as Edit Issue>More options>JSON payload, not allowing the rule to be published:
"additional fields contains invalid field(s) in ‘update’ or ‘fields’ section: <Field_Name>"
This error indicates that the field, which name appears in <Field_Name>, is not accessible to the Actor user set on the automation rule.
診断
An automation rule may have an Action to edit an Issue, and instead of indicating a field and a fixed value, one can use "More information" in the Action configuration, to set the value using a JSON payload, for example:
{ "update": { "Approvers" : [ { "add": {"name":"{{<smart_value>}}"} } ] } }
When attempting to publish the Automation rule, the error will show for the Action, and won't allow publishing it:
"additional fields contains invalid field(s) in ‘update’ or ‘fields’ section: Approvers"
If setting a different Jira user as Actor (the user to execute the rule by), the error may not show for one user but will show for another, even when both users have the exact same Permissions (including Application Access, Group membership, Project roles, Assets roles etc.)
The error is not showing any additional details in the application logs.
原因
When an Automation rule is being published, the Action will be validated using the Actor user set on as rule's executor.
If the custom field, mentioned in the JSON, cannot be found by the Actor, the error will show:
- If there was a typo in the custom field's name, e.g. "Aprovers" instead of "Approvers" - in this case, the error will show for any user.
- If the Actor has a language preference set on their profile (e.g. Spanish), and the custom field has was translated to Spanish, the error will show, as "Approvers" is not a valid field for the Actor, due to translation.
ソリューション
There are 3 possible solutions:
Solution 1 (Recommended)
ソリューション:
- Identify the Custom Field ID of the Approvers field as explained in this KB article
- Go back to the automation rule
- In the JSON payload, use the generic "customfield_XXXXX" (XXXXX being the Approvers Custom Field ID identified in the 1st step)
Advantage of using this solution:
- This solution will work for any rule actor, regardless of their set language
ソリューション 2
ソリューション:
- Log into Jira as the Automation Rule actor,
- Navigate to the User's profile
- Set the User's language to English, so "Approvers" will be a valid field
Drawback of using this solution:
- The error may still appear for other fields, and existing rules may fail now.
ソリューション 3
ソリューション:
Use the translated field name in the JSON payload.
Drawback of using this solution:
- The error may appear for other fields, or, if the actor if changed later to another user who is using a different language in their profile