Hi Folks,
I've created a project using node module "passport-atlassian-oauth2" and i get the accessToken successfully. But when I do a request to create an issue I get the error "
Client must be authenticated to access this resource.
". Below is my code for create issue jira api:
var bodyData = { "fields": { "project": { "key": "FLUX" }, "summary": "REST ye merry gentlemen.", "description": "Creating of an issue using project keys and issue type names using the REST API", "issuetype": { "name": "Bug" } } };
var baseUrl = 'https://alamrezoanul.atlassian.net';
var options = { method: 'POST', url: `${baseUrl}/rest/api/3/issue`, data: JSON.stringify(bodyData), headers: { 'Authorization': 'Bearer ' + jiraTokens.accessToken, 'Content-Type': 'application/json' }, json: true };
axios(options) .then((response2) => { console.log("response2.data: ", response2.data); }) .catch((error) => { console.log("error: ", error); })
Could you help please?