The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation with custom field (JSON), error: data was not an array

Ольга Хомякова
December 6, 2022

Hi everyone!

I'm trying to add all users from the role in the project to the custom user field. But it gives an error "data was not an array"

My JSON looks like this:

{
"fields": {
"customfield_10301": "ProjectRole_10505"
}
}

What am I doing wrong?

Thank you in advance guys!
Kind regards,
Olga

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Mohamed Benziane
Community Champion
December 7, 2022

Hi,

Welcome to the community

You need to passe each user one by one like this:


"fields": {
"customfield_10301": { "name": "username" }
}
}

https://community.atlassian.com/t5/Jira-Core-Server-questions/How-do-I-set-a-custom-quot-User-quot-field-using-the-API/qaq-p/1654199 

Ольга Хомякова
December 15, 2022

Thank you! It worked!