It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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
Community showcase
Posted in Portfolio for Jira

Program managers, we need your help! We want to learn about how you plan work for a team of teams

Hi community members, My name is Erika and I’m a product manager at Atlassian. We’re currently investigating how teams are planning work at the program level. We understand that every team in a tea...

86 views 0 4
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you