Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
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

Need some help with API

Hi,

I have a VBA macro (code shown below). When I run the macro, it keeps giving me authentication error (shown below). I dont know how to provide authentication details in this code now, can you help?

I do get results back when I run the URL from browser.

URL - http://localhost:8080/rest/api/2/issue/TPP-1?fields=summary

Please suggest how to get this working?

 

VBA Code:

Sub Button2_Click()

Set MyRequest = CreateObject("WinHttp.WinHttpRequest.5.1")
MyRequest.Open "GET", "http://localhost:8080/rest/api/2/issue/TPP-1?fields=summary"
MyRequest.Send
MsgBox MyRequest.ResponseText

End Sub

 

Error:

{"errorMessages":["You do not have the permission to see the specified issue.","Login Required"],"errors":{}}

 

 

4 comments

I added authentication details to the URL, but still same error:

 

Sub Button2_Click()

Set MyRequest = CreateObject("WinHttp.WinHttpRequest.5.1")
MyRequest.Open "GET", "http://localhost:8080/rest/api/2/issue/TPP-1?fields=summary?os_username=psp;os_password=pwd"
MyRequest.Send
MsgBox MyRequest.ResponseText

End Sub

Tomas Gustavsson
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.
Sep 09, 2019
Warren
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.
Sep 10, 2019

Hi @Pravin 

Your main problem is that you shouldn't be using a password for authentication - it changed a couple of months ago - see this.

You should be using your Jira e-mail address and an API token generated with that same e-mail address.

If that still doesn't work, get back here and tell us what error you're receiving

Tomas Gustavsson
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.
Sep 10, 2019

That's only for cloud, is'n it?

Warren
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.
Sep 10, 2019

Yes it is, although nowhere on this page is it stated whether the question relates to cloud or server

Tomas Gustavsson
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.
Sep 10, 2019

I give you that ;-)

Sorry I should have mentioned that this is Jira Server install (http://localhost:8080)

Is there any ready code that I can reuse (with modifications) for pulling data from Jira server into Excel?

Getting tired of authentication errors and not able to get things working...

Please refer to the attached screenshot for the code that I was able to generate (thankyou Google :)-)

Even though my credentials are correct, I keep getting "Not Authorized" message.

Please suggest whats going wrong here...

UnAuthorized.JPG

Comment

Log in or Sign up to comment