I'm having a lot of trouble uploading an attachment to a created issue using the REST API. Currently I'm getting a 415 - "unsupported media type" error.
I would really appriciate some help with this. Thanks!
let actionData=new FormData();
actionData.append('file', files[0]);
actionData.append('comment', "foobar");
actionData.append('minorEdit', "true");
axios({
method: 'POST',
url: jiraApiUrl+'/issue/'+issueID+'/attachments',
headers: {
'X-Atlassian-Token': 'nocheck',
},
data: actionData,
}).then(response => {
//if (!cb) return { error: 'No callback' };
console.log('response-2', response);
return ;//cb(response);
})
.catch((err) => console.log('errorTest - files', err));