I am working on a NetSuite → Jira integration wher...
# integrations
s
I am working on a NetSuite → Jira integration where I need to attach a PDF to a Jira issue. The problem is that in SuiteScript,
file.getContents()
it returns the file content as Base64. When I send that directly in the
multipart/form-data
body, Jira stores the attachment as-is (Base64 string) instead of recognising it as a valid PDF. Has anyone solved this before? Thanks in advance!
x
It all depends on the api endpoint you're trying to hit and what its expecting. There's also a dedicated content type for PDF data. What is the api expecting?
s
@Xmun Thanks, that makes sense. I’m hitting the Jira attachments REST API (
/rest/api/2/issue/{issueIdOrKey}/attachments
). From NetSuite I only get the file in Base64 via
file.getContents()
. Do you know if Jira expects the raw binary stream there, or is Base64 with
Content-Transfer-Encoding: base64
acceptable?
x
I see a contentType in the request params so maybe you need to set that, but possibly also you may need to decode before sending.
s
thanks let me check