When I try to update "Developer" custom field in an automation script it fails with:
`Additional fields contains invalid field(s) in 'update' or 'fields' section: Developer`
I had been using a different field called "Original Developer" which worked well until one day it started failing to update the field. Thereafter any permutation of the json to update the custom field failed with the error above.
I created a new field in the project called Developer, and same error.
```
{ "fields": { "Developer" : { "id":"{{initiator.accountId}}" } } }
```
In another project I have created the Developer field and also a Tester field.
In this other project, Developer fails to save, whereas Tester works fine:
```
{ "fields": { "Tester" : { "id":"{{initiator.accountId}}" } } }
```
Both Developer and Tester fields are set to allow only one assignee
Also to note that I tried suggestions from other posts on this forum, and not found an answer that resolved my issue despite the same error message
Hi @Eloise Taylor ,
Welcome to the community !!
Example:
The casing was the same as the field. I did try all lowercase as well which also didn't work
This allowed me to save the automation rule:
{
"fields": {
"customfield_10245" : { "id":"{{initiator.accountId}}" }
}
}
But then errored when a ticket was updated
Error editing issues
E1-501 (data was not an array (customfield_10245))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Eloise Taylor ,
Please share the screenshot from custom field page for "Developer" and "Original Developer" fields and and the Automation rule setup.
Also let me know where are you creating the rule ? In team managed project OR company managed project OR in global automation section.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's a team managed project.
The field used to be multi-select, and is now single user. Could the current tickets on the board still have the multi-select variant?
To resolve, I have 2 automation rules: one that updates the field as if it's an array, and the other that updates as if it's not an array. If jira decides the field is no longer an array, the field should still update by the other rule. This means that one will always error. Once Jira knows the field can only have one user I can delete the unnecessary rule.
This approach only works now because of the custom field name, with the friendly name it won't save
{
"fields": {
"customfield_10244": { "id": "{{initiator.accountId}}" }
}
}
{
"fields": {
"customfield_10244": [{ "id": "{{initiator.accountId}}" }]
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just an FYI...
Regardless of what the UX indicates, all People-type fields in team-managed projects use the JSON array syntax (i.e., multiple-selection) even when a single-selection, user option is enabled.
When in doubt what automation rules (and the REST API) are needing, please use this how-to article to view an example issue's smart value / JSON structure: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Eloise Taylor and welcome to Community!
If Developer is a user picker custom field, you can directly set it to {{initiator}} in the automation rule:
Hope this helps!
- Manon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't see the field in the List of available fields, either when scrolling through, or searching
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.