Two Use Cases Here:
I know there are certain requirements you can set up in the Workflow, but we are a larger org using shared Workflows.
Will this JQL work for you
project = XYZ and "Epic Link" = EPIC# and issuetype = Story order by rank ASC
#2 For automation rule, you can try below. i have done it for Epic and related Issues. So if an Epic is Done then all issues under Epic are transitioned as Done.
You can similarly do it for Story and subtasks under it.
Hi @Russell Brown -- Welcome to the Atlassian Community!
For your first use case, I do not believe that is possible with out-of-the-box features of JQL, as JQL is not a SQL. There are addons from the marketplace which might help with such queries.
For your automation rule, that seems possible to write with a rule. What have you tried thus far to accomplish this? If you are just starting, please review this documentation and examples: