Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Query based on transition name

siva
Contributor
July 22, 2021

Can any one please help this, we had a workflow and having 3 transitions 'Door1' , Door2 and 'Door3' all these transitions in between  Open to Resolved status. When we move the status from Open to Resolved need to select any of those 3 transitions. Here the issue is unable to  prepare query 

project = xxx AND type = "xxx" AND status changed from open to resolved  and resolution != "xxxx"

It shows all 3 transitions issues but i need only 'Door1' transition issues only is there any query or else we are using script runner please share the relevant script that fulfilled this below query

project = xxx AND type = "xxx" AND status changed from open to resolved  and resolution != "xxxx"

Thanks in advance,

Siva.

1 answer

1 accepted

1 vote
Answer accepted
Matthias Gaiser _K15t_
Community Champion
July 22, 2021

Hi @siva

I‘m not aware of a way you can directly achieve that.

But for issues in the future, you can modify your workflow so that the different transitions add a label like door1, door2, door3 (or set any other custom field you want).

Cheers,
Matthias

siva
Contributor
July 22, 2021

@Matthias Gaiser _K15t_ 

Thanks for the reply, that's the good thought adding labels.

But still looking solution for my question.

Thanks,

Siva.

Nic Brough -Adaptavist-
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.
July 23, 2021

The transition used to move from one step (status) to another is not recorded by Jira, only the change of status is logged, and there is nothing to work with that you could infer it from either. 

So there's no way to search for it, even with Scriptrunner.  SR is powerful, but it can't do anything with data that simply isn't there.

To achieve your search by transition, you are going to have to implement logging of the transitions in your workflow, exactly as @Matthias Gaiser _K15t_ suggests.

I would not use a label myself, I would use a custom field.  The easiest one would be a simple select list called "Door", with options door1, door2 and door3 as options.  I would leave it off all the screens, so your humans don't mess with it or have it cluttering the screen (although you may want it on view).  You would then need to add a simple post-function to each transition.  You can see what's next - a post-function on transition "door1" would set "door" to "door1", door2 on door2, and door3 on door3.

Once you're recording the transitions like this, then your query can become something like:

project = xxx AND type = "xxx" AND status changed from open to resolved  and resolution != "xxxx" and Door = "door2"

You could even drop the "and status changed" clause if you know door2 will only be set by that transition.

(doors 1-3 now has me thinking of the Monty Hall problem again)

Like # people like this
Jack Brickey
Community Champion
July 23, 2021

+1 for custom field

Joe Pitt
Community Champion
July 23, 2021

I agree with both @Jack Brickey and @Nic Brough -Adaptavist- about the custom field. I routinely populate a date/time field for milestone transitions in a post function. 

siva
Contributor
July 23, 2021

@Nic Brough -Adaptavist- 

Thanks for the early reply, created custom field based on transition and it is working perfectly appreciated for your help and support.

Thanks,

Siva.

Suggest an answer

Log in or Sign up to answer