Forums

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

Get attachment URL from a form via REST API

Rudy Holtkamp
Community Champion
August 17, 2023

Hi,

I've a form with 10 different attachment fields.

If I take a look at the answers on a form via the REST API, I will see something like this:

 "82": {
"files": [
{
"id": "623521ee-7b28-4bff-b2e7-91cc24c5f0f1",
"name": "Screenshot_20230727_204151_Chrome.jpg"
}
]
}

Which does not give me a URL.

If I take a look at the issue itself via the REST AI it get:

 {
"self": "https://xxx.atlassian.net/rest/api/2/attachment/70694",
"id": "70694",
"filename": "Screenshot_20230727_204151_Chrome.jpg",
"author": {
...
},
"created": "2023-07-27T20:50:03.062+0200",
"size": 404781,
"mimeType": "image/jpeg",
"content": "https://xxx.atlassian.net/rest/api/2/attachment/content/70694",
"thumbnail": "https://xxx.atlassian.net/rest/api/2/attachment/thumbnail/70694"

Which give me the possibility to get the URL, but I should match on filename.

The problems is that filenames can be similar, so I'm not 100% sure that I do get the correct URL.

Is it possible to download the attachment with the id on the form (623521ee-7b28-4bff-b2e7-91cc24c5f0f1)?

Kind regards,

Rudy

0 answers

Suggest an answer

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

Atlassian Community Events