Hello,
I am trying to log work estimates via a REST API call using VBA. Here is my code. It is returning a code 400.
Sub UpdateJIRAWorkLogs()
i = 3
sResponse = MsgBox("Click OK to begin writing to JIRA", vbOKCancel)
If sResponse = vbCancel Then
Exit Sub
End If
lRow = Worksheets("Bulk Update Worklogs").Cells(Rows.Count, 1).End(xlUp).Row
While i <= lRow
sProject = "SISBTXTRPR"
sIssueType = "Sub-task"
sURL = "https://MyCompany.com/issues2/rest/api/latest/issue/SISBTXTRPR-383/worklog"
sData = "{""newEstimate"": 36000}"
With JiraService
DoEvents
.Open "POST", sURL, False
.SetRequestHeader "Content-Type", "application/json"
.SetRequestHeader "Accept", "application/json"
.SetRequestHeader "Authorization", "Basic " & UserPassBase64
.SetRequestHeader "X-Atlassian-Token", "nocheck"
.Send (sData)
If .Status = "401" Then
MsgBox "Not authorized or invalid username/password"
Else
End If
End With
i = i + 1
Wend
MsgBox "Insert Complete", vbInformation
End Sub