api rest autorisation issue

Mohammed Chaudhry August 25, 2022
Hello,
I come to you for help, when I try to make calls with the jira rest api, in response it tells me that I do not have the rights to see it or that the ticket does not exist


{
errorMessages: [ "Le ticket n'existe pas ou vous n'êtes pas autorisé à la voir." ],
errors: {}

5 answers

1 vote
ChristopherChilds August 29, 2022

with regard to which one you are connecting to. I would just login to the URI and the confirmation will be there for you.

1 vote
ChristopherChilds August 29, 2022

Jira Server/DC API documentation
https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/

Jira Cloud API documentation:
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-priorities/

Note that for authentication on Cloud, you will need to use the Basic authentication scheme. Whereas for Server/DC you will need Bearer scheme.
Server/DC:
https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html

Cloud:
https://developer.atlassian.com/cloud/jira/platform/basic-auth-for-rest-apis/

Also, check if you can access the ticket. Make sure that for this particular project, you actually have the required permission. Best is to check the permission scheme and cross-check with your user role, and to also just paste the url of the API into Firefox to test the output.

1 vote
ChristopherChilds August 25, 2022

Can you provide an example of the API and let us know if you are making the call to Jira Cloud or Server/DC?

0 votes
Mohammed Chaudhry August 31, 2022

hello christopher,
i am using jira cloud, and doing the project in node.js with package jira.js
 the code :
const jira = new Version2Client({
host:"https://project.atlassian.net",
newErrorHandling: true,
authentication : {
basic : {
email : 'chaudhry@domaine.com' ,
// password : 'toto'
apiToken : 'IEbzO2aSxUUZzIiOmOMfC9BF' ,
},
},
});

 

const projects = await jira.projects.getProject({projectIdOrKey : "WS"}, function(callback) {
console.log(callback);
});
console.log(projects);

i am realy in big difficulte i dont understand, they return me one "NULL"

0 votes
Mohammed Chaudhry August 29, 2022

hello, how can we know if we are making call to jira cloud ou server please ?

Suggest an answer

Log in or Sign up to answer