Forums

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

PUT request failing for 'description' field update on Issue with "Operation value must be a string"

Ashish Y
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!
July 22, 2020

I was trying to update description field of an Issue and using HttpUrlConnection (with PUT method ) on JIRA Cloud.

URL:

https://{company-specific}.atlassian.net/rest/api/latest/issue/PROT-80

Note: I'm successfully able to GET same issue details.

I have gone through expected format for system description field which is ADF mentioned here: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-put

Also, checked this thread  and tried same format.

Actual Json payload I'm using:

{"update":{},"fields":{"summary":"Test Case 1","project":{"key":"PROT"},"issuetype":{"id":"10005"},"description":{"type":"doc","version":1,"content":[{"type":"paragraph","content":[{"type":"text","text":"Abc"}]}]}}}

 Config and headers used in my connection:

httpUrlConnection.setRequestMethod(HttpPut.METHOD_NAME);

httpUrlConnection.setRequestProperty(HttpHeaders.ACCEPT, ContentType.APPLICATION_JSON.getMimeType());

httpUrlConnection.setRequestProperty(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON.getMimeType());

httpUrlConnection.setDoOutput(true);

Response received from error stream of HttpUrlConnection:

errorstream: {"errorMessages":[],"errors":{"description":"Operation value must be a string"}}

 

Though, if I changed it to "description":"Description" then it will work. But documentation says it should have ADF format to retain HTML formatting. My original requirement is to keep formatted content.

Any help or pointers are highly appreciated! Thanks.

1 answer

1 vote
Owen Ramsay
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!
August 7, 2020

instead of "rest/api/latest"

try

"rest/api/3"

ADF is required in api/3

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events