Forums

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

Edit a customfield with REST API

Max77
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 22, 2020

Hi guys,

updating a customfield using the REST API works fine for me for simple fields.
Suppose I want to update the "dolor sit" to "lorem ipsum 5" on a customfield that looks like this:

"customfield_12543": {
"steps": [{
"id": 10123,
"index": 1,
"fields": {
"A": "lorem ipsum 1",
"B": "lorem ipsum 2",
"C": "lorem ipsum 3"
},
"attachments": []
}, {
"id": 10124,
"index": 2,
"fields": {
"A": "lorem ipsum 4",
"B": "dolor sit",
"C": "lorem ipsum 6"
},
"attachments": []
}
]
}

Do I have to PUT the whole structure everytime I want to change a single string in it?
Or is there some way to address the "B" with index 2 directly?
I looked for some time but could get it working.

Thanks!

1 answer

1 accepted

0 votes
Answer accepted
Sunny Ape
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 22, 2020

As far as I know, the entries in the fields aren't indexed such that the REST API can alter them individually; you can either replace (overwrite) all the values with new values, or add new values, which are added at the end of the array of values.

v3 of the Jira REST API does have this new experimental method to alter custom field values, but the values still aren't accessed by any index or offset.

Max77
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 22, 2020

Thanks, David.

I was hoping to access an individual field - the change history can look quite messy if I update all values everytime I have to change a single field.

Also it's hard to spot what exactly was changed as the changes in the history are displayed unformatted.

Suggest an answer

Log in or Sign up to answer