I am trying to fetch attachment from JIRA using REST API(provide by Jira). But I am not getting the metadeta of attachment and it is giving me only a URL which is also secured. can anyone please help how to get attachment from Jira using REST API?
Hello @RishabhT,
Thank you for reaching out to Atlassian Community!
Just to make sure we are on the same page, I would like to confirm if you are using the API mentioned on the documentation below:
curl --request GET \ --url 'https://your-domain.atlassian.com/rest/api/3/attachment/{id}' \ --user 'email@example.com:' \ --header 'Accept: application/json'
If that's the case, I tested here and it shows the correct response.
Would mind sharing with us a screenshot of the response you receive?
Regards,Angélica
Hi Angelich,
Jira does not provide directly the content of the attachment but the secure URLs of the attachments.
Here my colleague @RishabhT is concerned with the contents of the attachment.
The createmeta request working fine but returning only URLs perhaps we need file actual content in the form of base64/blob of the attachment.
So, Is there a way to fetch the content of the attachment ?
We are getting following response currently.
Hello @Merajul Hasan,
Thank you for the details.
I'm afraid this is not possible using API. Blob is recorded in the database which can't be accessed in Jira Cloud.
The only APIs available are the ones from the documentation and none of them returns what you need.
Also, I didn't find any feature request suggesting this ability, so please, feel free to raise one on jira.atlassian.com (project JRACLOUD) adding more details about why this feature is important for your environment.
Hi @Angélica Luz
Is it still not possible?
I am also looking for the same, using content URI, I would like to get contents so we can insert that attachment in our system.
Atlassian introduced an experimental endpoint to read attachments.
GET /rest/api/3/attachment/content/{id}
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-attachments/#api-rest-api-3-attachment-content-id-get
It looks like this endpoint returns the binary now.But I have no idea how to convert it into base64Any idea how to do that?
@Angélica Luz Could you please help with this?
It looks like you're new here. Sign in or register to get started.