Hello,
I’m trying to add an attachment to my jira Issue but i’m not able.
here is my code
fonction:
const add attachment = async () => {
const form = new FormData();
form.append(‘file’, manifest.txt
);
const response = await api.asUser().requestJira(route/rest/api/2/issue/AD-3/attachments
, {
method: ‘POST’,
body: form,
headers: {
‘Accept’: ‘application/json’,
‘X-Atlassian-Token’: ‘no-check’
}
}).then(response => response.json()) ;
//console.log(await response.json());
return response;
// console.log(await response.json());
};
implementation:
const [attach] = useState(async () => await addattachment());
console.log('reponse status '+attach);
error:
Trace ID: 9f9770a048a136e5
There was an error invoking the function - function () { [native code] } could not be cloned.
Can anyone help me please