Unable to download attachments using AP.request

Hi,
Is there any possibility to download the attachments using Connect JavaScript API? I’ve tried using AP.request, but any request for the attachment content just gets me the file content as text, which obviously corrupts all the binary attachments. Since the AP.request does not permit any other content-type than text, I simply don’t know how to handle this.
I need to provide the same functionality which I have in plugin for the standard Jira to the cloud version, but this is now a blocker for me.
Can anyone point me to some other solution for the problem?
Are there any plans to change the AP.request to fetch any content type, rather than just text?

2 Likes

Hi @mariusztusinski ,

I have updated ACJIRA-2379 to cover this capability.

Regards,
Dugald

1 Like

Thanks! I hope that this can be implemented in a reasonable time frame, as we really need an option to download the attachment programmatically into memory

3 Likes

Hi,

@dmorrow
Is there any update on this issue ?

I can see there is new option to get attachment as binary in AP.request options:

binaryAttachment
If this is set to true, the developer is specifying a request for an attachment consisting of binary data(e.g. an image) and the format of the response will be set to “arraybuffer”.

Link to reference:
https://developer.atlassian.com/cloud/jira/platform/jsapi/request/

Unfortunately it doesn’t work - the response is still as text (not as expected - arraybuffer)

Also I can see the same issue for confluence is resolved: CONFCLOUD-72542