Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Auto assigning custom field "Developer" keeps breaking

Eloise Taylor September 11, 2024

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

 

2 answers

1 accepted

2 votes
Answer accepted
Rilwan Ahmed
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 11, 2024

Hi @Eloise Taylor ,

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

Eloise Taylor September 11, 2024

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

Rilwan Ahmed
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 11, 2024

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.

Eloise Taylor September 12, 2024

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

 

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

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

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

 

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 12, 2024

Hi @Eloise Taylor 

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

Like Steffen Opel _Utoolity_ likes this
0 votes
Manon Soubies-Camy
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 11, 2024

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:

initiator.png

Hope this helps!

- Manon

Eloise Taylor September 11, 2024

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events