Recently we have integrated the Jira Rest API into a custom support portal product we are developing in house. I am attempting to create a web component that displays comments on an issue and any attachments within the comments as clickable thumbnails that can be downloaded once the user clicks the thumbnail.
Below is my rest call:
https://wtgjira.atlassian.net/rest/api/3/issue/ABC-123/comment?startAt=0&maxResults=10&orderBy=-created&expand=renderedBody
I am using renderBody to output the comment as HTML but have ran into an issue.
Here is a sample of the renderBody output which I then display in a div within my component.
"renderedBody": "<p>By default, cards take all the available width in their parent container, but you can use the <tt>width</tt> and <tt>max-width</tt> classes to control take control of the card’s dimensions. So, let’s change the previous example by reducing the width of the card:</p>\n\n<p><span class=\"nobr\"><a href=\"/secure/attachment/12494/12494_Snippet.cs\" title=\"Snippet.cs attached to XER-11\" data-attachment-type=\"file\" data-attachment-name=\"Snippet.cs\" data-media-services-type=\"file\" data-media-services-id=\"aa14ccc7-a4d3-4803-bba3-9353332c7e5e\" rel=\"noreferrer\">Snippet.cs<sup><img class=\"rendericon\" src=\"/images/icons/link_attachment_7.gif\" height=\"7\" width=\"7\" align=\"absmiddle\" alt=\"\" border=\"0\"/></sup></a></span></p>\n",
The problem is it includes the attachment as a link that appears to go no where what does /secure/attachment/12494/12494_Snippet.cs correspond to?
It would be ideal to have a way to return a renderBody without the attachment links then I could handle them myself. Or I will have to find a way to parse out the attachment links from the renderBody output. Is there a way to use renderBody and omit the attachment links?