I've got a problem during my transitions :
I wrote a groovy post-function script that is executed during the closed transition of a child issue.
This script has to verify if all the other children of its mother are closed. If they are, the mother is put into a new status (and the current child close), otherwise, just the current child is closed.
But I have another requirement : when a user wants to put the mother into the new status (the same as precedent), a transition condition has to verify if all the children are closed.
So, the first script works, but when i add the second one into the mother new status transition, and when i want to close a child, the first script cannot put the mother into the new status because the second script detects a child not closed (the child is not closed yet).
How could i do ?
I found a solution :
My first script (executed in the child close transition post-function) was executed BEFORE the issue passed in closed state. And that why the other script, executed when the mother have to be put in its new state detected the child not closed.
So, i put the first script in a transition condition to leave the closed state (i've got an administrator state in the child workflow, that be able to go everywhere from anywhere ...). Finally, the script is exetuted AFTER the child passed in closed status, and the mother script detects the child closed.
|Congratulations, that's it
Have a chocolate!
Thank you Jamie for your answers :)
I can't really get my head around your problem. Have you written your own code?
Perhaps you could use either or both of https://studio.plugins.atlassian.com/wiki/display/GRV/Built-In+Scripts#Built-InScripts-Allsubtasksmustberesolved and https://studio.plugins.atlassian.com/wiki/display/GRV/Built-In+Scripts#Built-InScripts-Transitionparentwhenallsubtasksareresolved.
Is what you are saying that, when you close the subtask, the parent should also close, but it doesn't because your condition is saying a sub-task is still open? If so try changing the order of events, make your post-function on the child run last.
Or you could detect if a post-function is running and ignore the condition, maybe by making the condition only valid for non-admin users, or by setting a session variable or thread-local or something. I'm sure there is an easier way than that though.
Is what you are saying that, when you close the subtask, the parent should also close, but it doesn't because your condition is saying a sub-task is still open?
Yes it is. My child post-function script verifies if all other mother children are closed, and if it's true, it closes the mother. But in the close transition of the mother, there is a script condition that verify if all children are closed : so the first script calls the second (when all other children are closed) but the second script detects an opened child (the child who wants to be closed).
So i want my first script (post-function script on the child close transition) executed AFTER its status changement, because when the second script will be called, it will detects the child closed, and not opened ...
Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...
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!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG