How to create a No-Transition Transition

If you are a Jira admin, you know that the very heart of Jira is the workflow. One of the key jobs that you have is to work with your users to implement workflows that are both simple and effective to meet their needs. I am sure that there are times when your user has requested a particular workflow capability that is far outside the normal ticket flow. This article discusses one such request.

Occasionally, a user will ask for an action that can be executed from any status without changing the current status of the ticket. I had one client who needed to be able to execute a particular set of post-functions at any point within the workflow without changing the status of the ticket. We looked at several approaches to address this requirement and settled on a “No-Transition transition”.

This is very different from a transition that returns to the same status. In the image below, you see a very simple workflow: Open → In Progress → Done. I have added a transition from In Progress back to itself called “Do It”.

image-20200622-133430.png

This is a very standard way to allow execution of a set of post-functions without changing the status. You have probably implemented this dozens of times in your own environment. The problem with this solution is that it only works from the “In Progress” status. You can’t run it from Open or Done.

You could implement the same transition on Open and Done as well, but then you have three transitions that you have to maintain instead of one. If you have a more complex workflow with 8 or 10 steps, this approach quickly turns into a nightmare.

We needed a way to have the transition be globally available, regardless of the status. Fortunately, in Jira Server, this is possible by doing some manual manipulation of the workflow. Here is how you can do it.

The steps that you will take to implement this are:

  1. Create your base workflow

  2. Export the workflow as XML

  3. Make a small change in the XML

  4. Import the XML as a new workflow

Here are the details:

Create your base workflow

For our purposes, we are going to use the workflow that we created above. Instead of having the “Do It” transition go from “In Progress” to itself, we are going to create a new Status called “Do It” indicating that all statuses can transition to this one.

image-20200622-140605.png

Notice that if you left this workflow as is, you could never exit the “Do It” status. Our next steps will solve that.

Export the workflow as XML

Now that you have the base workflow ready, you need to export it as XML. Pull down the Export button and select “As XML” and export the workflow.

Make a small change in the XML

Open the XML file in a text editor or XML editor. I use Notepad++, but you can use any text editor or IDE that will allow you to edit an XML file.

With the XML file opened, search for the transition. This will be in an “action” XML tag. Here are the key lines from my XML file

<global-actions>
<action id="31" name="Do It">
<meta name="jira.description"></meta>
<meta name="jira.fieldscreen.id"></meta>
<results>
<unconditional-result old-status="null" status="null" step="4">

The key line from the above snippet is the line that reads “<unconditional-result old-status="null" status="null" step="4">. You need to change the step=”4” to be step=”-1”

Also note that this action is in a section called “<global-actions>”. That is accomplished by using the “All statuses transition to this status” option. If you have other “All” transitions, they will also appear in this section. Make sure that you take care to update the right one.

Import the XML as a new workflow

Now you are ready to import the workflow. Go to the Workflows page and “Import As XML”

image-20200622-141155.png

You will need to give your workflow a new name since the name you used is already taken.

Select the “Paste the workflow XML definition” option and paste in the XML from your editor, as shown above.

The new workflow will show up under the Inactive list, since it is not yet used in a Workflow scheme. When you look at the workflow in Diagram mode, it will look like this:

image-20200622-141450.png

The “Do It” status and transition have been disconnected from each other. This transition will be available regardless of the current status of the issue. You can delete the “Do It” status from the workflow. We can never reach it anyway.

This new “Do It” transition has all of the properties and capabilities of a regular transition. You can set Conditions and Validators on it. You can add whatever post-functions you want. It will work just like any other transition, except that it is always available and never changes the current status of the issue.

9 comments

Matt Doar
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 24, 2020

Useful reminder, and one of the ways to effectively add a magic button to the Jira view issue screen.

I think Rachel Wright came up with the term "looping transition" and I borrowed it for Practical Jira Administration.

I thought that adding looping transitions was possible in the Jira admin UI though? In Data Center 8.5 I seem to be able to use the graphical editor and Add a Transition as below. Did I miss something?

Screen Shot 2020-06-24 at 12.37.35 PM.png

Christian Pascher
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.
June 25, 2020

@Matt Doar yes, you are right. This way of transition is available if you click in the graphical configuration of the UI on the button to add a transition since forever.

Taranjeet Singh
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 22, 2020

@C_ Derek Fields This is a great hack to know.

Michael Werner September 2, 2020

I'm pretty new to Jira. What is a use-case for this? How do I use this type of transition?

Mathieu Rousseau January 21, 2021

@C_ Derek Fields and @Matt Doar 

interesting, but once created, it seems we can't see transitions to itself in the new layout of JIRA issue screens. Any hint ?

maricris.macha January 24, 2021

In Jira Cloud we are able to add the transition using "any status" to "itself" but can't see the option to transition using the active workflow in the tickets. 

Like David Walsh likes this
Mathieu Rousseau January 27, 2021

Dear all, you can vote for https://jira.atlassian.com/browse/JRACLOUD-72667 (Any Status Transition to itself on Workflow doesn't show on New Issue View)

Dawn Fama March 27, 2021

I did this in my test instance thankfully, and it seemed to impact 30 workflows instead of just the project it was intended for.

It changed the open status to the new status.  I think the step where you  delete the “Newly created status" from the workflow forced Jira to takeover an existing status name.  In my case it was the Open status.

Has anyone else ran into this issue?

Dawn Fama March 27, 2021

I did this in my test instance thankfully, and it seemed to impact 30 workflows instead of just the project it was intended for.

It changed the open status to the new status.  I think the step where you  delete the “Newly created status" from the workflow forced Jira to takeover an existing status name.  In my case it was the Open status.

Has anyone else ran into this issue? 

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events