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

sindujb May 1, 2023
Future<Map<String, dynamic>> getIssue(String issueKey) async {
    final url = 'https://******.atlassian.net/rest/api/3/issue/$issueKey';

    final response = await http.get(
      Uri.parse(url),
      headers: {
        'Authorization':
            'Basic ${base64Encode(utf8.encode('$username:$apiToken'))}',
        'Content-Type': 'application/json',
      },
    );
    if (response.statusCode == 200) {
      final issue = jsonDecode(response.body);
      return issue;
    } else {
      throw Exception('Failed to load issue');
    }
  }
This is my dart code.. When I manually click on the response url I can view the json format of the issue . But I am getting the above error in my code 

1 answer

1 vote
Karim ABO HASHISH
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 3, 2023

hi @sindujb 

I'm not an expert with dart but i suspect that you have an issue with the authentication part.

I'd suggest the below steps

  • Please test your connection with the right parameters using postman
  • For connecting to JIRA API you need to create API Token first then use it for the password and your registered email as the username. 
  • you may use this link to create your API Token


Below is an example using postman. hope that would help

UttPxJ37P7.png

 

Let me know how it went for you.

Cheers,

Karim

SCS user May 11, 2023

I struggled with this FOREVER.....and thanks to your answer, I figured out I had to use the API Token as the password.  Thank you!

Like aa20034lk likes this
Karim ABO HASHISH
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 12, 2023

hi @SCS user 

Glad it worked for you.

Please mark the answer as accepted so it would help other community users looking for a solution to a similar issue

Cheers,

Karim

Like SCS user likes this
SCS user May 12, 2023

I am not the OP so I cannot accept it as the answer…but I did upvote it in hopes that people see it helped others.

Karim ABO HASHISH
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 13, 2023

Thanks @SCS user for your support and Feel free to refer back if you have any questions.

Like SCS user likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events