Hi All,
Using below VBA code to get the details of an issue, i am able to connect to jira successfully with oJiraAuth method.
But when i am trying to connect to particular issue using oJiraService getting Error code 401
Actually i am planning to get different issue details by passing the issue id through excel data sheet. so tried to pull the details of one issue using the below code.
Please let me know how to fix this issue.
Dim oJiraAuth As MSXML2.ServerXMLHTTP60
Dim oJiraService As MSXML2.ServerXMLHTTP60
Set oJiraAuth = New MSXML2.ServerXMLHTTP60
With oJiraAuth
.Open "POST", "Myjira url/rest/auth/1/session", False
.setRequestHeader "Content-Type", "application/json"
.setRequestHeader "Accept", "application/json"
.send " {""username"" : ""karthi"" , ""password"" : ""password!""}"
sOutput = .responseText
sCookie = "JSESSIONID=" & Mid(sOutput, 42, 32) & ";Path=/Jira"
status = .status
stext = .statusText
If status = 200 Then
MsgBox "Connected to Jira successfully"
Else
MsgBox "Not connected to Jira"
End If
End With
'MsgBox sCookie
Set oJiraService = New MSXML2.ServerXMLHTTP60
With oJiraService
.Open "GET", "Myjiraurl/rest/api/2/issue/CPPMLA-1", False
.setRequestHeader "Content-Type", "application/json"
.setRequestHeader "Accept", "application/json"
.setRequestHeader "Set-Cookie", sCookie '*** see Create a "Cookie"
'MsgBox sCookie
.send
sRestAntwort = .responseText
MsgBox " status " & .status
End With
Set oJiraAuth = Nothing
same issue here. Connected succesfully but using the Service returns 401
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.