I need to query the status of a bug, from VBA code in an Excel sheet.
Which strategy is best, for such an external query? Which interfaces are provided by JIRA?
We use cloud JIRA.
Use the REST API: https://docs.atlassian.com/jira/REST/latest/
Hi Nic
Thanks, but I cannot find any example VBA code to try out. Could you point to some?
Does VBA instantiate any class to authenticate, and how do I install that class on the client side?
BW Peter Hansen
Using the below VBA code (I intentionally replaced my pwd with xxx) I got the error: Run-time error '-2147024891 (80070005)'
Sub Makro1() Dim JiraAuth As New MSXML2.XMLHTTP60 Dim LogInREST As Boolean
Dim sErg As String Dim sPfad As String Dim Cookie As String
'Login to JIRA with the default user' With JiraAuth .Open "POST", "http://pension.atlassian.net/jira" & "/rest/auth/1/session", False .setRequestHeader "Content-Type", "application/json" .setRequestHeader "Accept", "application/json"
.send " {""username"" : """ & "pbh@pension.dk" & """, ""password"" : """ & "xxx" & """}"" '*** HTTP-Request senden"
If .Status = "200" Then MsgBox ("Hurra!") Cookie = "JSESSIONID=" & Mid(sErg, 42, 32) & "; Path=/" & sPfad LogInREST = True End If
End With
End Sub
I'm afraid I've managed to stick to Dijkstra's theory and not damage myself by learning any BASIC, especially VBA..
I'm afraid that's a runtime error in the application you're coding in, it's nothing to do with JIRA (unless that has sent back a request VBA can't process, but even then, it should only return JSON or a simple "can't do that")
Have you tried this with the Better Excel Plugin's VBA capabilities? It sounds as that is an inverse of the approach your original question suggests, but that may even be a better approach.
http://www.midori-global.com/products/jira-better-excel-plugin/documentation/visual-basic-macros
It looks like you're new here. Sign in or register to get started.