Forums

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

multitransition loop

pawel.gryzewski July 11, 2018

Hi

I have some strange thing to do - i know it is doable but have no idea how to do it.

The case is that i have a transition from status A => A and i need to launch the same transition screen over and over until condition is met. (I need to launch several postfunctions  after it - they will create related issues etc)

Biz Case may be difficult but at the and it should work sth like create another checkbox but during the transition and that's a MUST.

 

Have anyone got any ideas how to manage this? Is it possible with groovy postfunction?

 

3 answers

0 votes
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 16, 2018

This is the wrong approach.  Post-functions are too late.

Write a validator instead.  When the transition screen is given to the user, a validator will check whatever you need to check at the point they click the confirmation.  If it fails the check, it will return the user to the transition screen.

On the last click where the validation passes, then your post-functions can run.

pawel.gryzewski July 16, 2018

hey - thanks for your answer but the case is that I do want postfunctions to run  - its a must because i'm making some magic then :) the case is that i want to make it over and over (postfunctions) until condition is met. I cannot do it in loops in a script because i need every loop to take values from fields inserted by user in transition and every time i'd be different - thats why i need to show transition screen again after all postfunctions have run.

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 16, 2018

No, that's the wrong approach.

A transition is there to change the status as an issue moves on through the process.  You do not want to change the status if conditions are not met.

Your "post functions" are not the right way to do it.  They are really actions you should be taking before even looking at a transition.  Once they've been done, then you allow the transition.

What I would do is

  • Use ScriptRunner to write a script which tries to do all these actions, and includes a way to say "they all worked" (I don't know what they are, or how you might count success, but an obvious one is to set up a field on the issue that says "it has worked", and set that on success.  You could even hide it from the screens, as users don't really need it)
  • Create a web-fragment that inserts the action into the UI to run the script
  • Create a condition that blocks the transition until the flag is set to say "it has worked"
0 votes
pawel.gryzewski July 15, 2018

Hey - doesn't anyone know how to call transition screen in post function? I think its the only way to achieve goal.

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 16, 2018

No.  Post-functions cannot have screens attached, because it's the wrong place.  Post-functions happen when the user has committed to a transition, it's too late to be asking them for data.  You should have asked earlier.

0 votes
Mirek
Community Champion
July 11, 2018

Hmm.. Not quite sure what you would like to achieve. You want to execute some transition (and show screen) until some condition would be met? Could you please clarify?

pawel.gryzewski July 11, 2018

Exactly :)

I'd want to make some transitions go over and over without making user to 'click workflow buttons'.

Example:

User is working on a issue in some status and he is using transition button (transition has destination status set the same as initial one). When transition screen shows up and one Custom-Field has been set to specific value i'd like jira to generate all post-functions from transition and show again the same transition screen so user could set new field's value over and over without clicking the same button over and over.

I have some specific business-case on to it:)

pawel.gryzewski July 11, 2018

thanks - second link is a good workaround 4 me - unfortunately its not good for final resolution because using it I'd have to rewrite >70 postfunctions which i already use. It doable but I'd be very hard to maintain. Best resolution 4 me would be to figure it out how to launch transition and show to user display screen (something like 'fasttrack transition an issue' postfunction but with extra hold for displaying transition screen).

pawel.gryzewski July 11, 2018

in other hand that's also not a workaround because listners don't work without events;/

so i'm still at the beginning;/

Suggest an answer

Log in or Sign up to answer