Hello all. I am new to Jira. I have a client who uses Jira. They would like their CMS to close a ticket when the CMS publishes a particular peice of content. At a high level what I'm thinking is that in the CMS they will input the id of the Jira ticket and then on the published event I will programmatically close the ticket.
My question is A) is this possible? B) Can you direct me to the correct API's and code examples???
Thank you very much!
Community moderators have prevented the ability to post new answers.
You can also close issues using JIRA REST API - http://docs.atlassian.com/jira/REST/latest/#id2474418
Transitioning issues via REST is support IIRC since 4.2.
And definitely REST is the way to go for the future. SOAP won't be enhanced in the future versions of JIRA, the focus is put entirely on REST.
REST tutorial is located here.
You may also consider using JIRA REST Java client (if you CMS uses or can easily use Java).
This is possible; have a look at this page:
http://confluence.atlassian.com/display/JIRA/Creating+a+SOAP+Client#CreatingaSOAPClient-SampleJavaSOAPclient, choose your version and create the sample code. Read the corresponding documentation here: http://docs.atlassian.com/software/jira/docs/api/rpc-jira-plugin/latest/index.html?com/atlassian/jira/rpc/soap/JiraSoapService.html.
Code in c# below. Btw - you might want to check if the user you use have rights, etc., before closing an issue. My code assume that the user you authenticate with have necessary rights.
public void CloseJiraIssue() { string token = string.Empty; var JiraService = new JiraWebService.JiraSoapServiceService(); try { token = JiraService.login("user", "pass"); JiraWebService.RemoteFieldValue status = new JiraWebService.RemoteFieldValue(); // The status field you want to update status.id = "status"; status.values = new string[] { "6" }; // Set it to closed status // Be aware - "2" is the Close issue transition in your projects workflow JiraWebService.RemoteIssue issue = JiraService.progressWorkflowAction(token, "PLAYGROUND-42", "2", new JiraWebService.RemoteFieldValue[]{status}); } catch{} finally { JiraService.logout(token); JiraService.Dispose(); } }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ivar - My apologies for the delay. This is a bit of a lengthy process for testing etc. BUT I REALLY appreciate your feedback and level of detail. I will be testing out in the next month or two and will let you know what I find.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It would be nice if you accepted one of the answers :)
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 progressIssue action.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.