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

JSON writing a username error

Martin May 25, 2023

Hi there, 

When we create delivery tickets to execute an idea, the team manager will assign a responsable on the created EPIC. I want an automation to send this assignee value back to a JDP custom field that I called: Project Manger. The custom field ID is: customfield_10475

However, It's not working right.

My script gives me the error: 

Error editing issues
OPJ-288 (data was not an array (customfield_10475))
Seams like I cannot go around that. My field type is: @ People field
Greenshot 2023-05-25 11.39.48.png

2 answers

0 votes
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.
May 25, 2023

Hi @Martin 

Please try using the accountId value, and not the displayName, to select a user in a single-select user field.  Here is the syntax for that:

https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Single-user-picker-custom-field

Kind regards,
Bill

Chris Timms
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.
May 26, 2023

Hi @Bill Sheboy 

Your solution does not tackle the reported issue, which is that the field entry is not in an array. Multi-user fields need to be added as arrays via automation even if you are only trying to add a single value. The error will be the same even if Martin tries the account ID. You cannot create single select use fields in JPD, I believe.

However, you have found the page I referred to in my answer, which demos this correct syntax for adding a field value in an array, so thank you!

Regards,

-C

0 votes
Chris Timms
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.
May 25, 2023

Hi @Martin !

is your custom field a multi select field or can it only have a single value? If it’s a multi-select field, you need to format your request as an array even if you are only storing a single value. I can’t find the samples on mobile, but Jira’s smart value documentation has enough info that allowed me to solve the issue previously.

regards,

-C

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events