I need to attach a screenshot to the created issue. I've followed the guide. I've been trying to set content-type to application/json, multipart/form-data or omit it. Getting 415, 500 and 403 respectively. I've included 'X-Atlassian-Token': 'no-check' header. I attach the image as 'file' to the form. The image is in base64 format, I've been trying to send it also as blob or File. Nothing works. Any ideas what might be wrong? I'm really frustrated at this point, ty in advance.
Image to send ( fileArr[key] ) is proved to be correct and renders in browser
var file is defined and proved to be unique (timestamp derived)
attaching one image only in purpose of testing
issKey and baseURL is proved to be correct (I successfully interract with issue in other ways and able to create it).
partial code:
Disclaimer:
I've lurked atlassian forum and seen the following topics -- one two three four five
None of the solutions worked for me
Hi @service I think some issue in your headers and form data. I have tested on my machine, it's working fine.
Jira Server Doc : https://confluence.atlassian.com/jirakb/how-to-add-an-attachment-to-a-jira-issue-using-rest-api-699957734.html
Add last two header in postman call and in body add key name file of type file so that you get option to select file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your effort, it really helped! Finally I figured out that my code is ok. The problem was in server. The correct way is to ommit the header (
For the future generations reading this: be sure to check role privileges and punch your admin. :D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@service Glad to hear, I am able to help you out :)
Kindly accept the solution, if it works for you. It helps others having the same query or issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @service ,
I omitted the Content-Type header, but I'm still getting the same 415 - Unsupported Media Type error.
What exactly did I have to do when you said, "Be sure to check role privileges and punch your admin. :D"
NodeJS code example:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.