I use a Script Listener to create a sub-task when a custom field value equals "Yes." I also use a Fast-Track Post Function to transition my workflow when:
issue.subTaskObjects.size() == 0
So essentially, I want to Fast-Track my workflow forward if there aren't any unresolved sub-tasks (Note: I recognized the condition above won't do what I need. I address that below.) . If I update the custom field value to "Yes" via a transition screen, I expect the Fast-Track to FAIL since a sub-task is created. However, this does not happen. I believe that what may be happening is that the Post Functions, including the Fast-Track, complete before the Script Listener determines I've updated the custom field to "Yes." So the sub-task is created AFTER the Fast-Track post function has completed.
The reason I think this is happening is because the Fast-Track is blocked, as I expect, when I complete the previously stated actions AND a sub-task already exists on the issue.
QUESTIONS:
Thanks for your help.
Hello @Gavin Minnis
I'm not Jamie, but
1. Yes, you are right. Script Listeners runs only when event happens and after all post-function.
2.
issue.subTaskObjects?.every {it.resolution != null}
As usual, thanks for your quick responses. Ok I think I can overcome my problem by requiring the team to make changes with the edit screen instead of the transition screen. It’s not ideal, but I can probably make it work. It is strange though, because I would think that the same issue would occur when the field value is set on the Create screen.
Regarding the other suggestion you gave about checking that sub-tasks are resolved, I’m not at a computer but will check and update soon.
Take care.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.