Hi all! First time poster :)
I need to attach an image to a Jira issue using the REST API.
I'm using the standard
/rest/api/2/issue/{issueId}/attachments API call.
Here's the frustrating part: I can get it to work just fine in Postman using the form data option for the body
But I cannot seem to get it to work using the Raw option and supplying the actual JSON:
I've tried it both with and without the Type attribute.
It always gives me either an 500 internal server error or a 415 unsupported media type. This is on the same file as works fine with the form data. I have my headers set up (I think) correctly for both.
Is it having a problem with the JSON being a part of the request - is the form data sending something different behind the scenes?
Any help would be greatly appreciated!
Thanks!
Mark
Okay, kinda figured some of this out - looks like you have to use the multipart form data to send these attachments, so I've changed my code to do that. Still having a weird problem where I'm getting a 200 response in my code, but the attachment isn't actually attaching in Jira...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.