I recently asked about creating linked Stories from Epics automatically, and got responses to help me setup Automation Rules (Here, for info: Solved: Automatically create a linked story when moving an... (atlassian.com))
I need to try and take it a step further by ensuring that if the Epic is moved out of In Progress, back to Ready, then later moved back to In Progress it doesn't create an additional story using the original rule. I have tried using If/Else components to reference the "labels" field in any existing stories or other linked issues - if it has any stories with the label set to "documentation", don't create another story. The steps are;
1. Epic is transitioned from "Ready" to "In Progress"
2. If there are no sub-tasks linked to the Epic with "labels = Documentation", create a story, linked to this Epic, with a label of Documentation in the Technical Writing project (The Epics will be in different projects)
At this point everything is fine. If the Epic is moved back to Ready (it's not common, but it is possible) and then at some time in the future transitioned back into In Progress, then currently the rule is run again and a duplicate story is created in the epic. What I'd like to happen is that it finds one or more stories with the label set to "Documentation" and so doesn't create a duplicate one, instead just logs a message in the audit log (this was the only option I could find as a "Do Nothing" option)
I'm not sure if it's because the stories are created i a different project or if I'm just not creating the rule correctly or in the best way. I've attached a screenshot of the current rule.
