REST API - Create issue description from HTML

Joep Oomens
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!
April 30, 2020

I want to create an issue with the API, but I want to (for example) include an image in the description. I'm new to using the API, so the description object is a little weird to me in the first place.

When I retrieve an issue from Jira, the description contains one of more "parts", but how do I get the correct description structure when doing the opposite (HTML / my own content to Jira)? I couldn't find some method in the documentation, so I'm wondering if someone can help me out.

FYI: I'm using PHP and cURL.

1 answer

1 vote
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 30, 2020

Hi @Joep Oomens -- Welcome to the Atlassian Community!

Here is a similar post where someone was trying to add an image to a comment using the REST API.  There appear to be 2 steps: upload the attachment, and then update the markup to use the image.

How can I add an image in a comment?

https://community.atlassian.com/t5/Jira-questions/How-can-I-add-an-image-in-a-comment/qaq-p/952016

 

Best regards,

Bill

David_Bakkers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 18, 2020

As Bills says and per the other article, you have to attach the image to the issue first and know what its ID is before you can refer to it.

Suggest an answer

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

Atlassian Community Events