Hi,
I am following this link . https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-comments/#api-rest-api-3-issue-issueidorkey-comment-post.
I did change the url in on myside however. When using this code it fails with .
"{
"errorMessages": [
"Can not deserialize instance of java.lang.String out of START_OBJECT token\n at [Source: org.apache.catalina.connector.CoyoteInputStream@810c29f; line: 1, column: 59]"
]
}"
url = "https://myatlassiansite.net/rest/servicedeskapi/request/GSD-139/comment"
auth = HTTPBasicAuth("me@me.com", "1234567894545604fefe64e")
headers = {
"Accept": "application/json",
"Content-Type": "application/json"
}
payload = json.dumps( {
"visibility": {
"type": "role",
"value": "Administrators"
},
"body": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget venenatis elit. Duis eu justo eget augue iaculis fermentum. Sed semper quam laoreet nisi egestas at posuere augue semper.",
"type": "text"
}
]
}
]
}
} )
response = requests.request(
"POST",
url,
data=payload,
headers=headers,
auth=auth
)
print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))
Please assist.
I'm not python expert, but could you change last line of code from
print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))
to
print(response.text)
so we will know what is returned as response text
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.