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.