500 error when adding issue attachment using API with Content-Type header set from Supabase function

Justin Smid
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 21, 2024

I am trying to set up a Supabase edge function that creates a Jira issue and adds relevant attachments, using the jira.js library.

Creating the issue works as expected, but I am getting the following 500 error when attempting to add attachments to the created issue using the library's `client.issueAttachments.addAttachment` function.


Error: https://gist.github.com/justinsmid/85eee719fa9771d5c2c3c4f255a12812

Since the error I was getting really didn't seem to have any useful information, I figured I would instead try doing the request manually, so I copy-pasted the library's function, and got the same error.

After some fiddling, I noticed that removing the Content-Type: "multipart/form-data" header got rid of the error, and now the attachments were being added successfully.

...why?

I don't think it's entirely on the Content-Type header, because I have also previously used the jira.js library in a separate nextjs project, and there the `addAttachment` function works fine, without any adjustments. So it seems to be a combination of the header and calling it from a Supabase edge function.

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events