400 error returned when access Jira rest api with excel vba(Jira version is 7.6.9)

Geo Zhang December 23, 2018

I am trying to access Jira rest api(Jira vision 7.6.9) with Excel vba, it always returns 400 and no response text at all.

It works with old version Jira rest api. Is there any issue with my script?

The script is as follows:

usernamep = UserPassBase64 

With JiraService
s = GetUrl + "/rest/api/2/search?jql=" + Query + "&startAt=" + _ CStr(Range("StartAt").Value) + "&maxResults=" + _ CStr(Range("MaxResults").Value)
.Open "GET", s
.SetRequestHeader "Content-Type", "application/json"
.SetRequestHeader "Accept", "application/json"
If usernamep = "NoAuth" Then
.SetRequestHeader "Authorization", "No Auth"
Else
.SetRequestHeader "Authorization", "Basic " & usernamep
End If
.Send

 

1 answer

0 votes
Safaa OUM October 1, 2019

Hello @Geo Zhang

Did you get any answer about this? I have the same problem : 400 status with an empty response . Is it something missing in the requestHeader ?

Here is my script :

With JiraService
.Open "GET", URLticket, False
.setRequestHeader "Accept", "application/json"
.setRequestHeader "X-Atlassian-Token", "no-check"
.setRequestHeader "Origin", URLJIra
.setRequestHeader "Content-Type", "application/json"
.setRequestHeader "Authorization", "Basic " + Base64Encode(loginJIRA + ":" + pwdJIRA)
.send " {""username"" : """ & loginJIRA & """, ""password"" : """ & pwdJIRA & """}"

 

Suggest an answer

Log in or Sign up to answer