2 years ago

#19581

test-img

Boyuis

Getting an error "Can not deserialize instance of java.lang.String out of START_OBJECT " even though the Json code is from Docs

I took this syntax for the payload from the formal docs of jira, yet i am still getting an error. I am using either python or curl both give the same error. I supppose this is a Json related issue , could you find what is wrong with the jason/payload and how do i go about fixing it?

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)

json

jira

jira-rest-api

payload

0 Answers

Your Answer

Accepted video resources