I have a comment on an Issue which has an image attached to the comment. I cannot find a way to get the URL of the image or to download the contents of the image. The comment API returns a JSON object describing the different sections of the comment. The section which holds the image attachment is described like this:
{
'type': 'media',
'attrs': {
'width': 924,
'type': 'file',
'id': '3b8c8cc8-0a4d-492a-8e1c-18214dc2afee',
'collection': '',
'height': 504
}
}
It seems the ID given here has no use. This is not the ID that is expected by the comment API. The comment API expects an integer for ID.
At the issue level, the API will return fields -> attachment -> list of attachments. This list will include the attachment for the image that is used in the comment. However, there is no information to know which attachment is for which comment image. This is because the IDs in the 'attachment' array are integers (e.g. 10010) and not the GUID-like ID that is given from the comment API.
Here is the same image from above as conveyed in the issue->field->attachment, with no way to know they are the same image or attachment:
'content': 'https://api.atlassian.com/ex/jira/000/..../rest/api/3/attachment/content/10010',
'created': '2022-04-18T19:48:49.244-0400',
'filename': 'Screen Shot 2022-04-16 at 2.37.09 PM.png',
'id': '10010',
'mimeType': 'image/png',
'self': 'https://api.atlassian.com/ex/jira/000/..../rest/api/3/attachment/10010',
'size': 96722,
'thumbnail': 'https://api.atlassian.com/ex/jira/000/..../rest/api/3/attachment/thumbnail/10010'},
From the Comment API, does the "content" attribute include text for a link to the attachment?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.