I am using JIRA Rest Api to create task.
fetch('https://<subdomain>.atlassian.net/rest/api/2/issue/bulk', {
method: 'POST',
headers: {
Authorization: `Basic ${Buffer.from(
'<email>:1qCieXr7eOVSq4ym4OamCF7A'
).toString('base64')}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: `{ issueUpdates: {
fields: {
parent: {
key: 'DEMO-21',
},
summary: 'new task',
issuetype: {
id: '10003',
},
project: {
id: '10000',
},
duedate: '2021-05-05',
},
} }`,
})
.then((response) => {
console.log(`Response: ${response.status} ${response.statusText}`);
return response.text();
})
.then((text) => console.log(text))
.catch((err) => {
console.log(err);
});
There was some issue with the development configurations.
it is working fine after fixing them.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.