On cloud you should always use accountId when it comes to a user field. In this case for a multipicker field that should be:
'{"fields": {"customfield_12904": [{"accountId": "5abcXXX"}]} }'
Hi @Rajesh Ale
Welcome to the community 🙂
Better Get the Issue from API, you'll have the format to edit the custom field via API that you need to be reflected in Jira
First make a GET call to Issue. Take a look at the format and use the same white editing (POST) the issue
Let me know if that works
Thanks,
Pramodh
Thanks for the welcome.You just wanted to welcome me by commenting or do you really know the solution ??This is what i get from get issue.
{"customfield_12904": [ {"accountId": "123111515","emailAddress": "abc@abc.com","displayName": "abc","active": true,"timeZone": "Etc/GMT","accountType": "atlassian" } ]}
Here it is
Use this as a sample and let me know if it works
curl --request PUT \--url 'https://your-site.atlassian.net/rest/api/3/issue/WSP-198' \--user 'email:token' \--header 'Accept: application/json' \--header 'Content-Type: application/json' \--data '{ "fields": { "customfield_10082": [{"value": "Apple"}, {"value": "Mango"}]}}'
Thanks
Yes, by sending accountId it worked. but generally I get emailAddress , is there a way for JIRA to pick accountId automatically ??
You will need to create some sort of datastore that relates an accountId to an emailAddress and call that from a function. On cloud, emailAddress is an object that is restricted based on the users' preference, so you do not want to rely on that object.
In terms of multi-picker fields, if you want to append users
It looks like you're new here. Sign in or register to get started.