Hi,
I am currently doing a code in nodes that would search for a specific issues with a certain status assigned to a certain user. I am following the code that is found on this link: https://developer.atlassian.com/cloud/jira/platform/rest/v3/?utm_source=%2Fcloud%2Fjira%2Fplatform%2Frest%2F&utm_medium=302#api-api-3-search-get
What is not clear is the bearer part, I'm not sure where I can get the access_token. I've created a API-token already still it gives me a 403 status.
Below is the code I am using:
var options = {
method: 'GET',
url: 'https://wordbean.atlassian.net/rest/search?jql=assignee in ("username") and status in (Handover, "In Review") and type not in ("Epic", "Story", "Client Project", "Daily Task")'',
auth: { bearer: ('donahcandia@gmail.com:mj0G54PBrKrDKdbNRWnSB44A').toString('base64') },
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: bodyData
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(
'Response: ' + response.statusCode + ' ' + response.statusMessage
);
console.log(body);
});
How do I get and identify the access_token? and can anyone show on how to fix the bearer auth issue.
Thank you.
Hi Donah,
To generate an access token on Atlassian Cloud please have a look at the documentation - API tokens
In the documentation you will also find an example how to use the token in your query
below I have added a curl example
curl -s -X GET -H "Content-Type: application/json" "https://wordbean.atlassian.net/rest/api/3/search?jql=assignee%20in%20('donahcandia@gmail.com')" --user donahcandia@gmail.com:mj0G54PBrKrDKdbNRWnSB44A
(assuming mj0G54PBrKrDKdbNRWnSB44A is your token)
Best Regards,
Ryans
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.