Expand is not working for html comments

Hi! I’m trying to retrieve comments in html by using the expand attribute mentioned here:

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-comments/#api-rest-api-3-issue-issueidorkey-comment-get

with the following endpoint:
https://domain.atlassian.net/rest/api/3/issue/{{ticket-id}}/comment?expand=renderedFields

But I didn’t notice on the response any difference between using expand and not using it

May I using it wrong? thanks in advanced

@DanielSaavedra,

When I use expand=renderedFields on comments, I get an extra attribute called renderedBody with HTML text. The API response body looks like this (some data removed for readability):

{
  "startAt": 0,
  "maxResults": 1048576,
  "total": 1,
  "comments": [
    {
      "self": "...",
      "id": "10204",
      "author": { ... },
      "body": { ... },
      "renderedBody": "<p>When we deploy a SeeSpaceEZ Plus server in cloud after about 100,000 requests we see that the server runs out of memory and crashes.</p>",
      "updateAuthor": { ... },
      "created": "2021-03-31T06:35:09.187-0500",
      "updated": "2021-03-31T06:35:09.187-0500",
      "jsdPublic": true
    }
  ]
}

Without the expand parameter, the body attribute is the only representation of the comment content in ADF.

Could you please attach the endpoint sample ?

Guess what,
If I use expand=renderedBody instead of expand=renderedFields (which is what the documentation says to use) I got the field you mentioned as response.

@DanielSaavedra, so sorry!

How right you are about the request I actually made was using renderedBody not renderedFields. The docs at the top might talk about the renderedFields (I agree that it’s confusing) but the specific endpoint does say:

Use expand to include additional information about comments in the response. This parameter accepts renderedBody , which returns the comment body rendered in HTML.

1 Like

Thank you very much!

Good Day, @ibuchanan

Is it possible to POST HTML using the rest API? I solved the ADF to HTML problem, now I need assistance converting HTML to ADF.

Thanks