Forums

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

Unable to update custom user field via Rest API

Andrew Boeger
Contributor
September 17, 2021

Hello,

I'm trying to update 2 custom single-choice user fields on an issue via the Rest API but it's failing. I'm getting a 204 response indicating success, but the field isn't actually updating. I am trying all different combinations of samples I'm finding in these forums -- using the "update" section, using the "fields" section, using "set" vs "name" vs "id" vs "accountId". I'm using a valid email and accountId based on the user I'm getting back from the users API. The Jira documentation is just not helping very much here and the success response without any action is really irritating.

Can anyone help me out?

 

{"fields":
{"customfield_10092":
[{"name":"andrew.-------@vivun.com"}],
"customfield_10093":
[{"accountId":"60d5a76------6a939f0c"}]
}
}

{"fields":
{"customfield_10092":
[{"id":"andrew.-------@vivun.com"}],
"customfield_10093":
[{"set":"60d5a76------6a939f0c"}]
}
}

 

3 answers

1 accepted

3 votes
Answer accepted
said kouzibry
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 17, 2021

Hello Andrew, 

Try the following format and let me know what effect it has : 

 

{
"fields": {
"customfield_10092" : { "accountId" : "60d5a76------6a939f0c"},
"customfield_10093" : { "accountId" : "60d5a76------6a939f0c"}
}
}
Ivan Lima
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 17, 2021

Yeah, this option should work. My APIs are all working with that, and I'm using v3.

Like said kouzibry likes this
Andrew Boeger
Contributor
September 17, 2021

It works!!!!!

 

Thank you!!!

Like said kouzibry likes this
0 votes
Mehmet A _Bloompeak_
Atlassian Partner
September 17, 2021

Hi @Andrew Boeger , Welcome to the community!

You can check the format of json first by calling the issue get rest API.

  • First set the custom field value manually using Jira UI.
  • Then call the get issue rest API to get the json format.

Hope it helps.

0 votes
Andrew Boeger
Contributor
September 17, 2021

I used the format from this post exactly and get the same 204 response with no update taking place. https://community.atlassian.com/t5/Confluence-questions/Update-customfield-in-JIRA-using-REST-API/qaq-p/1606078

I tried getting the issue's details via API and these 2 custom fields are shown, and they have values populated if I use the web interface.

But once I submit my update API call above, the one getting the 204 response, it actually erases the value of these fields and sets them to null.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events