HI Community
In my forge application I am unable to add an attachment to an issue via Rest API.
Call within forge application returns 415 - unsupported media type
Call from standalone script works well
// call within my forge application alway returns in an 415 - unsupported media type
const response = await api.asUser().requestJira(route`/rest/api/3/issue/${issueKey}/attachments`, {
method: 'POST',
body : form,
headers: {
'Accept': 'application/json',
'X-Atlassian-Token': 'no-check'
}
});
// call from a standlone scritp works
let response = await fetch('https://rwai-test.atlassian.net/rest/api/3/issue/TPD-178094/attachments', {
method: 'POST',
body : form,
headers: {
'Authorization': `Basic ${Buffer.from(EMAIL+':'+API_TOKEN).toString('base64')}`,
'Accept': 'application/json',
'X-Atlassian-Token': 'no-check'
}});