We are wanting to add attachments to an existing service desk using the POST API from our React Native application. We are only receiving back "JSON Parse error: Unexpected EOF" from the API. here is our post:
const formData = new FormData();
const fileParts = ["Hello Jira!"];
const blob = new Blob(fileParts, {type : 'text/plain'});
formData.append('image', blob, 'file_name.txt' );
await fetch('https://THING.atlassian.net/rest/servicedeskapi/request/{ID}/attachment', {
method: 'POST',
headers: {
'Authorization' : 'Basic BASE64',
'Content-Type': 'multipart/form-data',
'X-Atlassian-Token': 'no-check'
},
data: formData
})