Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,509
Community Members
 
Community Events
176
Community Groups

How to get Jira Issue Comment attachment URL

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'},

 

2 answers

1 accepted

0 votes
Trudy Claspill Community Leader Apr 18, 2022

From the Comment API, does the "content" attribute include text for a link to the attachment?

Like Milánovics Péter likes this

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events