I want to use curl to download the images I have on an issue (as attachments). The problem is the API doesn't return the URL that leads to these images.
"content" : "https://INSERTCOMPANY.atlassian.net/secure/attachment/10013/image-20201217-080137.png"
The content field URL returned by the API is not what I'm looking for. When entered in the browser this url downloads the correct image, but since it doesn't actually point towards the image I can't use the curl function on it.
Hi @Liviu Florea
Welcome to Community! You will need to parse the url in the API to get the right link for you to be able to download attachments.
Hi, I'm afraid I'm a bit lost. Can you elaborate on your last answer, maybe provide an example ?
What endpoint did you use? I would use the GET Issue endpoint if I want to get the full url for an attachment from an issue then output the result. I can show an example but it's in python would that be preferable?
I have tried using the GET issue and GET attachments endpoints so far. I would appreciate seeing the python example.
Try use this: https://xxxxx.atlassian.net/rest/api/2/attachment/{attachment_id}
The attachment id can get from this:
https://xxxxx.atlassian.net/rest/api/latest/issue/{issue_id}
the above image url actually not a direct one to the image, but redirect with some additional validate behind the sence
It looks like you're new here. Sign in or register to get started.