Auto assigning custom field "Developer" keeps breaking
Asked by Eloise Taylor:

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


Answers:
author: Rilwan Ahmed
body: Hi [@Eloise Taylor](/t5/user/viewprofilepage/user-id/5420883) ,

Welcome to the community !!

1. Smart values are case and space sensitive. So did you confirm you have the correct name for that field? You can check that using an example issue with the field <https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/>
2. Did you try using the field id in the rule ?

Example:

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/346777i160E5A5C2CF249DD/image-dimensions/362x272?v=v2 "image.png")

comments: author: Eloise Taylor
body: The casing was the same as the field. I did try all lowercase as well which also didn't work

<br />

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))


author: Rilwan Ahmed
body: Hi [@Eloise Taylor](/t5/user/viewprofilepage/user-id/5420883) ,

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.


author: Eloise Taylor
body: 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?

![Screenshot 2024-09-12 at 08.59.22.png](https://community.atlassian.com/t5/image/serverpage/image-id/346984iA158684DE6DF2F53/image-size/large?v=v2&px=999 "Screenshot 2024-09-12 at 08.59.22.png")

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

![Screenshot 2024-09-12 at 09.07.03.png](https://community.atlassian.com/t5/image/serverpage/image-id/346988iCF2460447E2D7690/image-size/large?v=v2&px=999 "Screenshot 2024-09-12 at 09.07.03.png")

```
{
"fields": {
"customfield_10244": { "id": "{{initiator.accountId}}" }
}
}

{
"fields": {
"customfield_10244": [{ "id": "{{initiator.accountId}}" }]
}
}
```


author: Bill Sheboy
body: Hi [@Eloise Taylor](/t5/user/viewprofilepage/user-id/5420883)

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


author: Manon Soubies-Camy
body: Hi [@Eloise Taylor](/t5/user/viewprofilepage/user-id/5420883) and welcome to Community!

If Developer is a user picker custom field, you can directly set it to {{initiator}} in the automation rule:

![initiator.png](https://community.atlassian.com/t5/image/serverpage/image-id/346775i38C1B6A593F58E59/image-size/large?v=v2&px=999 "initiator.png")

Hope this helps!

- Manon

comments: author: Eloise Taylor
body: I don't see the field in the List of available fields, either when scrolling through, or searching

![Screenshot 2024-09-11 at 14.49.33.png](https://community.atlassian.com/t5/image/serverpage/image-id/346850i2FD4062DB8782551/image-size/large?v=v2&px=999 "Screenshot 2024-09-11 at 14.49.33.png")


Tags: custom-field