Posting comment to Jira ticket in python

sergey_green December 3, 2019

It is almost amusing, and yet frustrating.

url = {baseurl}/rest/api/latest/issue/{issueKey}/comment
body = {"body": "To change the way a picture fits .."}
r =  self.session.post(url=url, data=data), verify=False)

response

{"errorMessages":["Unexpected character ('b' (code 98)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: com.itlab.jira.plugins.extender.helper.RequestWrapper$1@537622; line: 1, column: 2]"]}

 What on God's green earth does it even mean?

2 comments

sergey_green December 3, 2019

Ah, nevermind, it has to be a string (not json).

DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 3, 2019

Yup! you got that right.

Gokul Ramanan December 23, 2020

@DPKJ : can I post HTML string and parse it as wiki string?

DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 24, 2020

@Gokul Ramanan I don't think that is possible. You have to send format accepted by comment field only otherwise it will get converted to text.

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events