Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

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.

7 comments

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

@Matt Doar__ LinkedIn 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 Jul 22, 2020

@Derek Fields This is a great hack to know.

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

@Derek Fields and @Matt Doar__ LinkedIn 

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

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. 

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)

Comment

Log in or Sign up to comment
TAGS

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