JIRA Transition using VBA


I am trying to create an excel macro which will automatically transition the status of JIRA's as per user input in the excel sheet.

We are using JIRA 4.4.5 version. Could anyone please help me out with some code snippets or formats for the post query (for VBA) that i can use to achieve my goal.

I googled a bit and found that i can access available JIRA transition states using the below code:

Private JiraService As New MSXML2.XMLHTTP60
Private JiraAuth As New MSXML2.XMLHTTP60

1. Create the "Cookie"/ session:

With JiraAuth
.Open "POST", "https://YourJIRAAddress/jira/rest/auth/1/session", False
.setRequestHeader "Content-Type", "application/json"
.setRequestHeader "Accept", "application/json"
.send " {""username"" : ""user"", ""password"" : ""passwort""}"""
sErg = .responseText
sCookie = "JSESSIONID=" & Mid(sErg, 42, 32) & "; Path=/Jira" '*** Extract the Session-ID
End With

2. Get the issue (here TEST-150):

With JiraService
.Open "GET", "https://YourJIRAAddress/jira/rest/api/2.0.alpha1/issue/TEST-150/transition", False
.setRequestHeader "Content-Type", "application/json"
.setRequestHeader "Accept", "application/json"
.setRequestHeader "Set-Cookie", sCookie '*** see Create a "Cookie"

sRestAntwort = .responseText
End With

Now, I want to post a transition change on the above JIRA. Please help with your inputs. Thank You.

2 answers

Hello Mathias,

Thank you for your reply. However, both the methods posted in the link above are using curl and java.

I am using VBA and these commands did not work there. I was wondering if I could send a POST request via WINHTTP for transitioning the status and if so, then the possible format of sending the POST request in. Thank you

Hi Sayan,

Did you get the solution for this via VBA to get the transition?


I am also attempting to connect, however I am using VBScript.  Java is not an option as this is for Quality Center and it uses VBScript to customize.

I'm trying to auth using basic.  below is my existing code, modified from @Sayan


Set oXMLHTTP = ObjectCreate("WinHttp.WinHttpRequest.5.1")
   oXMLHTTP.open "POST", "http://jira.myurl.com/jira/rest/auth/latest/session", false
   oXMLHTTP.setRequestHeader "Authorization", "Basic (Base64String)"
   oXMLHTTP.setRequestHeader "Content-Type", "application/json"
   oXMLHTTP.setRequestHeader "Accept", "application/json"
   sErg = oXMLHTTP.response
   MsgBox "Results are: " & sErg
   Set sCookie = "JSESSIONID=" & Mid(sErg, 42, 32) & "; Path=/Jira"              '*** Extract the Session-ID
   MsgBox "Cookie: " & sCookie


I get back nothing in my Msgbox response, not even an error.  It seems strange, is there a way to build an authentication header through this method.





Suggest an answer

Log in or Sign up to answer
Community showcase
Posted 5 hours ago in Agile

What is Scrum? A good, bad, and ugly answer.

In a world of dark-scrum, faux-scrum, and scrum-butt, the question still remains: What is scrum and how do you do it “right?” That’s the question we set out to answer. I'm Max, I've been teaching c...

44 views 0 1
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you