Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Issue does not exist or you do not have permission to see it

Getting the response below when making the a request to get an Issue from Jira by Key.

errorMessages":["Issue does not exist or you do not have permission to see it."]

I don't believe its a permissions issue as I'm able to get it to work perfectly fine in Postman, yet when I follow the documentation on this page: https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-issueidorkey-get

I get the above response.

 

Note: I'm using an Admin Account for the Free tier of Jira.

 

1 answer

0 votes
Niranjan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jul 05, 2021

Hi @Zackary ,

The error message is clear about the issue and it is either the account that is trying to make a rest call does not have access to browse the project's issue, or application access or the issue is deleted.  Are you using the same type of authentication/credentials in postman as well?

What is the GET restapi call that you are using?

@Niranjan 

Yes I'm using the same credentials in postman and PHP.

Using Basic Auth:

Authorization: Basic b64_encode([username]:[api_token])

Postman:

Postman.png

// Using Unirest\Request

public function
getIssue($issue_id){
$headers = array(
"Accept" => "application/json",
'Authorization' => 'Basic ' . env('JIRA_B64_TOKEN')
);
$response = Request::get(
$this->host . 'issue/' . $issue_id,
$headers
);

var_dump($response);
}

Issue does exist:

TestIssue.png

Niranjan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jul 05, 2021

@Zackary - can you try to pass the issue ID directly in your PHP instead of passing it as variable?

Niranjan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jul 05, 2021

@Zackary - Can you try using the below code - using API token

// This code sample uses the 'Unirest' library:
// http://unirest.io/php.html
Unirest\Request::auth('email@example.com', '<api_token>');

$headers = array(
'Accept' => 'application/json'
);

$response = Unirest\Request::get(
'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}',
$headers
);

var_dump($response)

@Niranjan 

I tried using that and still I'm getting the same error stating that the user doesn't have permissions or the issue doesn't exist. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events