Dear Atlassian's,
I am working upon a project in which i have a requirement to automatically create defects using scripting.
My question is to is there any guide which could help me to achieve the task and What all attributes exposed to user(for e.g. can i post attachments, link jira defect to other existing Jira defects.)
your views on above vital to me, please do share your thoughts.
Regards, Rohit
+919560553033
Hi Paresh,
The code below is not returning the desired result:
Unable to post defect
***********************************************************
Dim restReq, url
Set restReq = CreateObject("Microsoft.XMLHTTP")
username = "abc"
password = "xyz"
url = "http://10.0.51.30:8080/secure/Dashboard.jspa?os_username=" & username & "&os_password=" & password & ""
restReq.open "POST", url, False
restReq.setRequestHeader "Content-Type", "application/json"
postdata = "{""fields"": { ""project"":{ ""key"": ""Orchestra Mobile"" },""summary"": ""Test Automation"", ""issuetype"": {""name"":""Task""} }}"
restReq.send postdata
Hi Paresh,
Thanks for your valuable information. I hope this will do.
But i have concern how can i find Syntax of the 'postdata' parameters such as priority, affected version/s etc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
JIRA Command Line Interface (CLI) is an alternative is you want to minimize development costs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Bob.
This give the fair idea about Methods and Parameters but still i want to know how can i find syntax for parameters. Just want to be sure before creating automatic defects as i have to work upon live environment for test.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The action and parameter reference is found here. Specific parameters will depend on what you want to do. A simple example is:
--action createIssue --project XXX --type Bug --summary "My summary"
I recommend creating a test project to play with so you can clean it up later.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have downloaded __ cli-plugin-jira-3.9.0.obr pluggin but unable to install it.
Can you help me out.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
From these discussions, you want the JIRA Command Line Interface (CLI) client available from the Marketplate Get It Now link. Follow the installation instrucutions - Installation and Use.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can call below code in you project.
Save below code in .vbs file and execute the vbs file accordinly. You need to further investigate how you can change parameters, add attachment etc.
You need to enable rest api in jira if not already.
Dim restReq, url Set restReq = CreateObject("Microsoft.XMLHTTP") username = "<yourusername>" password = "yourpassword>" url = "https://jiraurl/rest/api/2/issue?os_username=" & username & "&os_password=" & password & "" msgbox url restReq.open "POST", url, false restReq.setRequestHeader "Content-Type", "application/json" postdata = "{""fields"": { ""project"":{ ""key"": ""projectket"" },""summary"": ""Created via rest api"", ""customfield_10301"": {""name"":""it is group picker single field""} ,""priority"": {""name"":""Minor""} ,""description"": ""Created via rest api"", ""issuetype"": {""name"": ""type of issue"" }}}" restReq.send postdata Msgbox restReq.responseText
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Paresh,
The code below is not returning the desired result:
Unable to post defect
***********************************************************
Dim restReq, url
Set restReq = CreateObject("Microsoft.XMLHTTP")
username = "abc"
password = "xyz"
url = "http://10.0.51.30:8080/secure/Dashboard.jspa?os_username=" & username & "&os_password=" & password & ""
restReq.open "POST", url, False
restReq.setRequestHeader "Content-Type", "application/json"
postdata = "{""fields"": { ""project"":{ ""key"": ""Orchestra Mobile"" },""summary"": ""Test Automation"", ""issuetype"": {""name"":""Task""} }}"
restReq.send postdata
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
what is the error
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have not received any error but received a responseText
as screenshot below: And No defect is reported
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ResponseText is just returning the URL response, defect is not reported.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are using wrong URL.
change it to
url = "https://10.0.51.30:8080/rest/api/2/issue?os_username=" & username & "&os_password=" & password & ""
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.