Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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
TAGS
Community showcase
Published in Jira Software

👋 Looking for 15-20 volunteers to test Atlassian training content

Hi everyone! Are you interested in beta testing Atlassian University’s newest (unreleased!) training course? We’re looking for 15-20 volunteers to test our newest training course, Basic reporting...

562 views 21 25
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you