It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

cant get html rendred for a comments body Edited

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

1 accepted

1 vote
Answer accepted

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

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

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

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you