Error for code from docs "Can not deserialize instance of java.lang.String out of START_OBJECT"

Benny Horowitz January 5, 2022

I get this error even though the payload is taken from docs syntax:

{"errorMessages":[],"errors":{"comment":"Can not deserialize instance of java.lang.String out of START_OBJECT token\n at [Source: N/A; line: -1, column: -1] (through reference chain: com.atlassian.jira.issue.fields.rest.json.beans.CommentJsonBean[\"body\"])"}}

 

 

This is the code in python. I get the same error when using curl :

import requests
import json

url = "https://jira.company.io/rest/api/latest/issue/ISS-37424/transitions"

payload = json.dumps({
"update": {
"comment": [
{
"add": {
"body": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"text": "Bug has been fixed",
"type": "text"
}
]
}
]
}
}
}
]
},

"transition": {
"id": "2"
}
})


headers = {
'Authorization': 'Basic YmVzQ=LKKJYTFTgfg','

Accept': 'application/json',
'Content-Type': 'application/json',

}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

0 answers

Suggest an answer

Log in or Sign up to answer