Atlassian Document Format to HTML

Phil_Dimeski March 4, 2019

Hey there, 

I am currently in the process of updating my usage of Jira's API to the new v3. With the introduction of Atlassian Document Format is there going to be support for converting this format into HTML, especially for worklogs? 

If there won't be support for this, is there a way to get the body of a comment and worklog not in the Atlassian Document Format? It was very easy to extract the body of a comment and worklog in v2 as opposed to now having to dig into a nested JSON structure.

 

Cheers, Phil

2 answers

1 accepted

1 vote
Answer accepted
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 29, 2019

Hi @Phil_Dimeski ,

You may be interested in following the below bug ticket in order to see how it goes:

 

Also, even if it is not so clear in the documentation, a way to get the comment body returned as HTML is to call the GET /rest/api/3/[ISSUE KEY or ID]/comments endpoint and append ?expand=renderedBody to it. This way you get something like:

 "renderedBody": "<p>SOME COMMENT<br/>\nTEST BODY<br/>\nsadff<br/>\ndffffffffffffff</p>\n\n<p>istamana</p>\n\n<p>I write a comment</p>",

 

Unluckily this does not work for worklogs comments.

 

Cheers,
Dario

faisalamdani July 14, 2021

does this work for descriptopn field also?

Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 15, 2021

@faisalamdani 

What, using the v2 endpoint or adding ?expand=renderedBody?

Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 23, 2021

 

Furthermore, I have created a Feature Request to have a public REST API endpoint to convert among formats:

  • JRACLOUD-77436 - Provide a public REST API endpoint to convert between ADF, HTML, Markup and Markdown now that pf-editor-service has been decommissioned

You may want to vote and watch the above feature request so that you will get notified in case of any update. The  feature will be addressed according to the Implementation of New Features Policy.

 

Also, as a workaround, you can find a slightly outdated version of the code available in the public atlaskit repo:

 

Cheers,
Dario

0 votes
Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 11, 2019

Hey Philip,

There has been some discussion around this on the Developer Community:

Unfortunately I don't have any details to share currently about a potential endpoint or method that returns HTML. However, the product management teams involved with ADF have been notified of the need and agree that this should be easier for developers. My best advice at this point is to keep the discussion running on the Developer Community so the issue stays top-of-mind.

Cheers,
Daniel

Suggest an answer

Log in or Sign up to answer