How to know the ordinal number of the current step in a Workflow

For statistical purposes,  I'd like to know if it possible to know the ordinal number (1 : first,  2 : second,  3 :third, so on)  of the current step in a WorkFlow.  Are they stored in a field perhaps?  At the moment, there are not any  script runner  plugin.  Thanks. 

3 answers

0 votes

If you mean "how many steps in a workflow", then no, it's not really stored, but you can just look at the workflow to see how many there are.

If you mean "how many status has a particular issue been through", then it's not directly stored, but you can work it out from the history.  Bear in mind that it's perfectly possible for issues to go back and forth, so your "ordinal" for, say, "in progress" might well be a set  (e.g. it was in that state 2nd, 4th, 7th, 9th, 14th etc)

You will need code if you want to expose these directly as fields.

0 votes
Joseph Pitt Community Champion Jun 01, 2016

It sounds to me like you want to know if the workflow status has a number that represents it's position in the workflow, Like this Open (1) -> In Progress (2) -> test (3) - Closed (4) . If so, I don 't believe JIRA stores that. Remember, statuses can be used in many workflows so it can't be part of the status definition. If you need that you should create a custom field and populate it with the step number as you define it in a post function of the transition going into the status in question. So when moving from open to in progress you set it to 2.  Put the field only on the view screen so it can't be edited.

That's a better way of explaining what I was getting at in my second point.

In Joe's example, the ordinals for a well behaved issue would be 1, 2, 3, 4.  But imagine a failed test - you'd get it go through six ordinals, but not 1, 2, 3, 4, 5, 6.   It would be 1, 2, 3, 2, 3, 4.  So "ordinals" fail really because 2 and 3 are no longer unique.

Thanks a lot for your answers!


Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 09, 2018 in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

249 views 6 0
Join discussion

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