Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I add a attachment to the comment using rest API?

Rohit Sarkar
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 15, 2022

Currently I am using the API "https://<my jira url>/rest/api/2/issue/<issue Id>/comment" to post my comment to jira and the body that I am sending is 

"
{"body":"*qwert* _qwert_ \n+qwert+ \n****qwert**** ***\n*** \\!https://<my jirta url>/rest/api/2/attachment/content/10077\\!\n","visibility":null}
"

Ihave also tried with : 

{"body":
"*qwert* \n\n _qwert_ \n\n +qwert+ \n\n ****qwert****\n\n
<span class=\"image-wrap\" style=\"\"><img src=\"/rest/api/3/attachment/content/10089\" height=\"164\" width=\"160\" style=\"border: 0px solid black\" /></span>,
"visibility":null}

 

but it Doesn't seems to work.


Here I have already attached the attachment to jira and using the attachment Content URL  inside  "!<attachment content url>!" this works for discription field. 

how but not sure why its not working for the comment field can anyone help me with the response.

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events