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

danielLuis May 31, 2016

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
danielLuis June 14, 2016

Thanks a lot for your answers!

 

0 votes
Joe Pitt
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 1, 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.

Nic Brough -Adaptavist-
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 1, 2016

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.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 31, 2016

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events