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 Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

Meet the AUG leaders of Northern Virginia

@Rachel Wright (Jira Genie), @Billy Poggi (AUG NOVA, DC), and @Dana Jansen (Confluence Queen) are just some of the folks that lead one of the world's most active Atlassian User Group (AUG)....

135 views 5 9
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