Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Download attachment from comments

muhammad August 4, 2023

Hi,

I want to download an attachment from the comments section. Like the attachment we upload on comments section separately. 

Right now I'm getting the following response in a comment attachment:

04.08.2023_11.45.33_REC.png

 

I have tried with the following endpoints already:

1- https://---.atlassian.net/rest/api/3/attachment/content/b1901303-2af2-453b-bf00-f6bd1f6b3fde

2- https://---.atlassian.net/rest/api/3/attachment/b1901303-2af2-453b-bf00-f6bd1f6b3fde

 

But every time, I'm getting error like 

The attachment with id 'b1901303-2af2-453b-bf00-f6bd1f6b3fde' does not exist
Please could anyone suggest a better way to download the attachments coming inside comments of issue.

1 answer

0 votes
Jehan Bhathena
Community Champion
August 6, 2023

Hi @muhammad ,

There is no direct way to download the attachment (unfortunately).

Found this one post by @Sam Watkins : https://community.atlassian.com/t5/Jira-questions/Linking-inline-image-to-attachment-using-API/qaq-p/1980564#M555940

Tested it out at my end too, and it works.

muhammad August 6, 2023

Hi @Jehan Bhathena ,

 

Thanks for responding. I have even tried the URL, https://example.atlassian.net/rest/api/3/attachment/content/<id>

 

with the Id I'm getting in attrs array, it giving attachment doesn't exists, could you tell further more, If I'm missing something here. 

Jehan Bhathena
Community Champion
August 6, 2023

Hi @muhammad ,

pleaae can you share what ID did you use to fetch the attachment? the ID thats needs here is the actual Attachment ID and not the content ID that you see in the comment.

Eg. https://example.atlassian.net/rest/api/3/attachment/12345 should give you the attachment info.

muhammad August 14, 2023

@Jehan Bhathena  I have used this endpoint too, and getting error like

 

The attachment with id 'bd5228f0-af85-4c4a-848a-0a1c5799f53e' does not exist
Im using that same id coming  in the attribute
Jehan Bhathena
Community Champion
August 14, 2023

Hi @muhammad 

Would recommend you go thru this thread https://community.atlassian.com/t5/Jira-questions/Linking-inline-image-to-attachment-using-API/qaq-p/1980564#M555940

The id you mention is not going to fetch the attachment.

muhammad August 14, 2023

No, its not working. I have tried all. But unable to fetch that specific attachment. 

Jehan Bhathena
Community Champion
August 14, 2023

Stumbled across this https://community.atlassian.com/t5/Jira-Software-questions/Attachments-coming-in-comment-section/qaq-p/2449460

 

Since you've already started a new thread, would request you to mark the current thread as accepted or add another comment to mark your solution as accepted.

muhammad August 14, 2023

Sure.

Like Jehan Bhathena likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events