Forums

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

Attachment content API returns gibberish?

Iker Gómez Eiras
Contributor
May 21, 2025

Good <insert your current time of day here>,

I want to throw myself of a bridge.

I'm trying to download a .png file and then, inject it into a separate ticket in another instance (my company has multiple) and store it as a file in one of our machines.

I'm trying to do this via PowerShell 7, don't know if that matters much.

The point is, I can't.
If I grab whatever the "/attachment/{id}/content" endpoint returns and try to save it to disk, "GRAH! ERROR! INVALID FORMAT!"
If I try to inject it into the other instance, it appears to work, but the file is completely broken and unreadable.
If I try to convert it to Base64 first, and THEN save it to disk, "GRAH! ERROR! INVALID FORMAT AGAIN, YOU MORON!"
If I try to convert it to Base64 first and THEN inject it into the other instance, it appears to work, but the file is completely broken and unreadable, and almost doubles the size of the original, as if to rub salt in the wound.

I think I'm doing what I should -- I grab the ticket data, go to fields, attachment, content.
Then attack that API, with the same headers (The documentation doesn't seem to indicate any special requirements for headers?The Jira Cloud platform REST API) but the data I get as a return appears to be completely broken and unusable?

Any idea as to what I may be doing wrong? Any specific way I need to treat the data before I can use it that I'm missing?

 

Thanks in advance.

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