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

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,560,083
Community Members
 
Community Events
185
Community Groups

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

sindujb
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 01, 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 03, 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
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
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!

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
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
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