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

0 votes
Answer accepted
Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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!

Suggest an answer

Log in or Sign up to answer