Update custom field adding new values

albertogarci86 June 22, 2018

Hi all,

 

I want to update a custom field via curl API REST. It is a text field multiline type.

I can update the custom field (13630) but it always displays the last value.

curl -k -D- -u "user:pass" -X PUT --data '{"fields":{"customfield_13630": "'"\nMessage:: This is a test"'"}}' -H "Content-Type: application/json" https://jira.com/rest/api/2/issue/BUG-0000

Any way to do that appending the new values and not removing the old ones?

Thanks in advance!

Regards

4 answers

2 accepted

2 votes
Answer accepted
Chander Inguva
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.
June 22, 2018

Hey Alberto,

Unfortunately this is not possible, you need to know the previous value to append the new value to it.

 

It always updates the existing value by design.

 Ref: https://community.atlassian.com/t5/Answers-Developer-Questions/JIRA-Append-field-content-via-REST/qaq-p/546140

No luck!!

 

Thanks

Chander Inguva

0 votes
Answer accepted
daniel_gamez July 15, 2020

This is marked as solved but has no answer

1 vote
miikhy
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.
June 22, 2018

Hi Alberto,

As mentioned by @Chander Inguva, not by default. I would advise you to retrieve te current value in a first curl and append your new value in a second step!

Good luck!

0 votes
albertogarci86 June 22, 2018

Ok @Chander Inguva@miikhy, thanks for the quick response.

So bearing in mind your answer I have to curl a get action and save the output before append the new value.

From that point, do you know any easy way to receive the text plain from the text field? Or do I have to do it formatting the json output?

 

Best Regards!

Suggest an answer

Log in or Sign up to answer