It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

JIRA REST call via GET returns 400 response code Edited

Hello,

 

This is the URL I am submitting via GET REST call:

 

https://mycompany.com/issues2/rest/api/latest/search?jql=project=SISBTXTRPR AND issuetype=sub-task AND status in (Open, "In Testing", "In Development", "In Review", "Ready For Testing", "In Development - Hold", "In Review - Hold", "In Testing - Hold", "Acceptance Pending")and Sprint in openSprints() order by assignee, key 




When I paste this URL in a browser, I get properly formatted JSON response. When I submit thru VBA code, I am getting 400 response. I have also submitted thru a browser REST plugin and I get proper JSON in response. I am using basic authentication like below. BTW, this is vba code:

 

Public Function ConnectToJIRA(ByRef sText As String) As Object
With JiraService
DoEvents
.Open "GET", sText, False 
.SetRequestHeader "Content-Type", "application/json"
.SetRequestHeader "Accept", "application/json"
.SetRequestHeader "Authorization", "Basic " & UserPassBase64
.Send ""

If .Status = "401" Then
MsgBox "Not authorized or invalid username/password"
Else
End If

logFile.WriteLine "JSON Response" + vbCrLf + "=============" + vbCrLf + JiraService.ResponseText
Set JSONObj = JsonConverter.ParseJSON(JiraService.ResponseText)
Set ConnectToJIRA = JSONObj
End With
End Function

Public Function UserPassBase64() As String
Dim objXML As MSXML2.DOMDocument
Dim objNode As MSXML2.IXMLDOMElement
Dim arrData() As Byte

arrData = StrConv("username:password", vbFromUnicode)
Set objXML = New MSXML2.DOMDocument
Set objNode = objXML.createElement("b64")
objNode.DataType = "bin.base64"
objNode.nodeTypedValue = arrData
UserPassBase64 = objNode.Text
End Function

Can someone tell me what is going on? Thanks.

2 answers

So, after further troubleshooting, somehow strangely it is not liking these items:

 

 "In Testing", "In Development", "In Review", "Ready For Testing", "In Development - Hold", "In Review - Hold", "In Testing - Hold", "Acceptance Pending"

 

These are in quotes because there are two separate words. It used to work just fine until one day it decided to stop working.

 

Does anyone know how to fix this issue?

0 votes
Steven Behnke Community Leader Jan 02, 2020

Can you provide the actual output you get from a successful and a failure ?

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you