I have two workflows that are not interacting the way I expect. (What I'm about to describe is simplified but still shows the problem. Sorry it's so involved but I don't see how to make it any simpler and still do what I need.)
There is a story workflow and an epic workflow. Both workflows have 3 states: Open, In Progress and Done. The automation is intended to implement two rules:
1) When the last linked story moves to In Progress, the Epic moves to In Progress.
2) When the Epic moves to In Progress it moves all the linked stories to Done.
I implemented rule 1) with a post function on the Story transition from Open to In Progress that tries to move the linked Epic from Open to In Progress PLUS by putting a condition on the Epic Transition from Open to In Progress that only allows the transition if all the linked Stories are in In Progress.
I implemented rule 2) by putting a post function on the Epic transition from Open to In Progress that moves all the linked stories to Done.
I tried this with two stories attached to the epic and all 3 issues in Open.
When I move the first story to In Progress and the Epic doesn't move. (expected behavior)
When I move the 2nd story (which is the last story) to In Progress, the epic moves to In Progress. (expected behavior)
The first story moves to Done. (expected behvior)
The problem is that the 2nd story (the last story to move into In Progress) gets stuck in In Progress and does NOT move to Done. (problem)
QUESTION: Why doesn't that 2nd story move to Done? And how do I fix this?
I believe this might be a timing issue: the 2nd story hasn't completed it's transition to In Progress before the Epic tries to move it to Done. But I don't know how to fix that...
Any suggestions?