Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Can I use the JIRA API with VBScript?

Paul Stahlke
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 27, 2015

Hi, we have a legacy system where we need a VBScript to create JIRA tickets.  Does anyone have any suggestions/info/links to show me how I can make JIRA API work with that?  Thanks.

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Paul Stahlke
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 6, 2016

I successfully connected to the JIRA API using this VBScript: 

Dim restReq, url, auth

Set restReq = CreateObject("Msxml2.ServerXMLHTTP.6.0")

url = "http://my.jira.instance/rest/api/2/application-properties"

'the following base64 authentication string was created at any base64 conversion site by using the "username:password" format
auth = "(my_base64_username:password)"
restReq.open "GET", url, false
restReq.SetRequestHeader "Authorization", "Basic " & auth
restReq.send

WScript.echo restReq.responseText
1 vote
rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 27, 2015

Hello Paul,

Thank you for your question.

You could be run something like:

Option Explicit

Dim restReq, url, uname, passw

Set restReq = CreateObject("Microsoft.XMLHTTP")

' https://docs.atlassian.com/jira/REST/latest/#d2e1496
' Returns an application property.
url = "http://jira.domain/rest/api/2/application-properties"

' <your-username>, i.e.: myuser
' <your-password>, i.e.: mypasswordABC
uname = "<your-username>"
passw = "<your-password>"

restReq.open "GET", url, false, uname, passw
restReq.send

WScript.echo restReq.responseText

If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing the same issue you have inquired.

Thank you for your understanding.

Kind regards,
Rafael P. Sperafico
Atlassian Support

 

Paul Stahlke
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 19, 2016

What would creating an actual ticket look like?  Eg: How to specify a summary and description?

0 votes
David John December 20, 2016

below is the way to create a ticket in jira.. -

 

Dim restReq , url, auth

strJSONToSend = "{""fields"":{""project"":{""key"":""Project""},""summary"":""Test Hello"",""issuetype"":{""name"":""Defect""}}}"

Set restReq = CreateObject("Msxml2.ServerXMLHTTP") 
URL= "http://onejira-testyourJiraURL/api/2/issue" 

'the following base64 authentication string was created at any base64 conversion site by using the "username:password" format
auth = "(YourAuthCode)"
restReq.open "POST",url, false 
restReq.SetRequestHeader "Authorization", "Basic " & auth
restReq.setRequestHeader "Content-Type", "application/json"
restReq.send strJSONToSend

WScript.echo restReq.responseText

set objJSONDoc = nothing 
set objResult = nothing

TAGS
AUG Leaders

Atlassian Community Events