Is there any way to reopen a ticket automatically through service

I can create n external service from JIRA which will call my api and with some response from that API. This service will be called on closed tickets only, which i will manage.

My concern is that, can we automatically change the status of ticket(s) to reopen if response from API is false (assuming response as true/false as of now).

Kindly suggest.

1 answer

If there is a workflow transition to reopen the issue, you can trigger that via the API in the case you receive a false response.

Thanks Thomas,

But can you be please more elaboraive , that how should i tigger that..?

Here is some PHP code:

if ( ! $yourResponse ){
    $jiraAPI->progressWorkflowAction($auth, $issueKey, "71", array() );
}
  • $yourResponse is the mentioned response on which you want to act when it's false
  • 71 is the workFlow actionid for the reopen step
  • array() is an associative array of fields to be set during the transition

Hope this is better helps

Thomas

Thanks Thomas,

This is really helpful. but it would be great if i can get to know the exact JIRA API and function to use, where i can found similar type of code which you had implemented.

I hope i am clear to you.

You could for example use the JiraSoapService from http://docs.atlassian.com/rpc-jira-plugin/latest/index.html?com/atlassian/jira/rpc/soap/JiraSoapService.html

(this is what we use at the moment as we havent switched to REST)

A simple somplete example class to use would be:

class OurJiraSoapHelper
{
	private $soap;
	private $auth;
	
	const JIRA_SERVER 	= 'example.com';
	const JIRA_PORT 	= '8080';
	const JIRA_WSDL 	= '/rpc/soap/jirasoapservice-v2?wsdl';
	
	public function __construct($user, $password){
		$this->soap = new SoapClient ("http://" . self::JIRA_SERVER . ":" . 
self::JIRA_PORT . self::JIRA_WSDL, array ("style" => SOAP_RPC,"
use" => SOAP_ENCODED,"soap_version" => SOAP_1_1,"uri" => "urn:myWS")); $this->auth = $this->soap->login($user, $password); } public function issueReopen($issueKey){ $this->soap->progressWorkflowAction($this->auth, $issueKey, "71", array() ); } }

(Provided that 71 is your action ID to reopen an issue)

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,323 views 14 20
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
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