Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Vivek K
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!
February 29, 2024

Hello Team,

I am using VBA code to get the issues from JIRA. But I am getting the error

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

Note working fine in Postman using Basi-Auth (Email and API token)

 

Username - vxxxx@gmail.com
APITOKEN = APITOKEN

Set JiraService = CreateObject("WinHttp.WinHttpRequest.5.1")
UserNamePQ1 = UserPassBase64

With JiraService
sURL = "https://<<JiraName>>.atlassian.net/rest/api/3/issue/KAN-8"

.Open "GET", sURL
'.SetRequestHeader "Content-Type", "application/json"
'.SetRequestHeader "Accept", "application/json"
.SetRequestHeader "Authorization", "BasicAuth Username:APITOKEN"
.SetRequestHeader "Content-Type", "application/json"
.Send

JiraService.ResponseText

End With

2 answers

0 votes
Dag Atle Stenstad
Community Champion
February 29, 2024

Hi @Vivek K Are you sure you have authenticated yourself?
Logging in requires encoding the username and Token to Base64.

.setRequestHeader "Authorization", "Basic " & EncodeBase64(strAtlassianEmail & ":" & strAtlassianToken)

The function below requires that you add "Microsoft XML, v 3.0" under Reference (Tools->Reference)

Private Function EncodeBase64(text As String) As String
   Dim arrData() As Byte
   arrData = StrConv(text, vbFromUnicode)

   Dim objXML As MSXML2.DOMDocument
   Dim objNode As MSXML2.IXMLDOMElement

   Set objXML = New MSXML2.DOMDocument
   Set objNode = objXML.createElement("b64")

   objNode.DataType = "bin.base64"
   objNode.nodeTypedValue = arrData
   EncodeBase64 = Replace(objNode.text, vbLf, "")

   Set objNode = Nothing
Set objXML = Nothing
End Function

 

Nic Brough -Adaptavist-
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.
February 29, 2024

Yes, that was my point

Dag Atle Stenstad
Community Champion
February 29, 2024

Did the code example work for you?

Nic Brough -Adaptavist-
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.
February 29, 2024

Yes, when I use a user who has the right permissions.

Like # people like this
0 votes
Nic Brough -Adaptavist-
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.
February 29, 2024

Welcome to the Atlassian Community!

This is most likely to be down to the user that you are using to log in and issue the commands not having the permission to see or work with the issue you are trying to use.

Suggest an answer

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

Atlassian Community Events