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 Join to answer
Community showcase
Jason Wong
Published Tuesday in Agility Beta

Welcome to agility

Every team in the world is unique, and so   Atlassian believes   that each and every team's best way of working  needs to  be molded to their unique circumstances  – ...

445 views 6 16
Read article

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot