cant get html rendred for a comments body

Zakaria December 3, 2018

hello i searched on the website and i found to get the html rendred using the jira api i just need to give an url like this :

https://jira/jira/rest/api/2/issue/403165/comment?expand=renderedFields

 

but this is returning the same thing if i take off the ?expand=renderedFields

 

me i just want to get the the html of the comments body is there any way to do this ? thank you

2 answers

2 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Chaitanya Nighot December 2, 2019

Hello @Zakaria RZ ,

you could also use the following URL, which can be an easy solution

https://jira/jira/rest/api/2/issue/403165/comment?expand=renderedBody

Regards

Chaitanya Nighot

Muhammad September 1, 2023

Very helpful, thanks a lot for saving the life

1 vote
Answer accepted
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 5, 2018

Hello Zakaria,

The API request for comments with the added expand=renderFields does not display the HTML code of the fields. What this expansion does it the following:

renderedFields = HTML-rendered field values in the response (Not HTML code)

Additionally you can find more about the renderedFields within the documentation at Class Issue.RenderedFields along with the API requests at Jira REST API (See expansion). There is additional data for API requests on Get Comments where examples are provided for available field names.

I hope this clarifies how to access data through API requests.

Regards,
Stephen Sifers

Zakaria December 10, 2018

Hello Stephen

Thank you for your answer

i figured out how to get the HTML of the comments so what i did was :

first a rest request using the Jira Api

https://jira/jira/rest/api/2/issue/"+id+"?expand=renderedFields"

the id is the issue id from where i want to get comments , the result is a lot of fields and also there is comment field which contain a body field inside where i can finally get the HTML format of the comment .

hope it helps someone over there if he is facing the same problem !

Have a great day Stephen

Regards

Zakaria Rihane

Like # people like this
Hannes_Haas August 24, 2023

@Stephen Sifers I use the .NET SDK to get tickets from our JIRA instance. How to get the HTML output with the SDK? Will need it for custom fields mainly....