Using the autotransition listener with many workflows

Greg Sommerville February 19, 2014

I've added the auto transition listener in order to reopen an issue if someone sends in an email relating to that issue after it's been closed.

The problem is that we use many different workflows, so the action ID varies depending on the type of issue - in other words, "Reopen" is a transition in most of our workflows, but it has a different ID in each. Because of this, I can't set up the auto transition listener properly because it's looking for a single action ID.

How can I solve this problem?

Thanks!

1 answer

0 votes
Sameera Shaakunthala [inactive]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 19, 2014

You can use a global transition for 'Reopen'.

https://confluence.atlassian.com/display/JIRA/Advanced+Workflow+Configuration#Advancedworkflowconfiguration-common_transitionsWorkingwithcommonandglobaltransitions

Or else, I can suggest you these two steps.

  1. If you have multiple 'Reopen' transitions in any single workflow, create a common action (re-usable transition) instead of all.
  2. Manually edit all workflows' XML and set the transition ID of 'Reopen' to the same number. Eg. 500
Greg Sommerville February 19, 2014

Thanks for the quick response.

A global transition is "global" only for a single workflow, right? It's not like I can set up one and it works across all of the workflows, correct? So it sounds like I'd need to set up one global transition per workflow.

On the other hand, if I can just go in and edit all of the workflow XML and assign my own ID to Reopen, that should solve it. Are there any potential problems with me doing that? That ID was assigned by JIRA, so I'm a little hesitant about going in there and just changing it however I feel...

Sameera Shaakunthala [inactive]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 19, 2014

Oops... sorry. My understanding of global transitions was wrong.

Please take whatever I've written below 'Or else...' as the answer. :)

I just went through a workflow XML where a common action is used. It shouldn't be a problem to change the action ID, but you have to change it everywhere.

Here's how common action should begin,

<common-actions>
    <action id="500" name="Reopen" view="fieldscreen">

And here's how it should be reused.

<common-action id="500" />

What you shouldn't mess with is step IDs.

Greg Sommerville February 19, 2014

OK, so I can edit the numbers of my transitions, but stay away from the step IDs.

Is that true if I'm not dealing with common actions? Let's say I just go in and edit the transition IDs for normal actions (not common, not global). Will that be OK?

Sameera Shaakunthala [inactive]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 19, 2014

Changing transition IDs should be OK. But don't overuse it. Do it only when required. If you have workflow-related plugins like Behaviours installed, changing some transition IDs may affect the plugin's functionality.

Regarding step IDs, each step ID represents a Status (global) in JIRA. Therefore I don't think it's a good idea to change step IDs. In your case you don't need to mess with them. :)

Be sure to take a backup of your workflow before performing any sort of modification to it.

--------

And don't be scared to modify workflow XML. :) :)

Suggest an answer

Log in or Sign up to answer