Jira Automation: How can I create an action to generate a story and multiple subtasks
I'm trying to create rule whereby a story with multiple subtasks is triggered by changing the status from Discovery to Started within a feature. I as was able to trigger and generate the story and sub-tasks. But the sub-tasks were added to the feature and not story. I was using Issue action" -> Create issue -> story and "Issue action" -> Create-sub-tasks. How can I generate the sub-tasks within a story? thanks for your help!
Hello @Jim P
You’re close, the problem is rule context.
Create sub-tasks always creates them under the current issue. Since your rule is triggered on the Feature, Jira treats the Feature as the current issue, so the sub-tasks get added there.
What you need to do is:
Trigger: Feature transitions from Discovery → Started
Action: Create issue → Story
Branch rule / related issues: Most recently created issue (this is the Story you just created)
Inside that branch: Create sub-tasks
That way, when “Create sub-tasks” runs, the current issue is the Story, so the sub-tasks land under the Story (not the Feature).
If “Most recently created issue” isn’t available in your DC version, the fallback is branching to the created Story via JQL using the created issue key (e.g. key = {{createdIssue.key}}).
Thanks Wroblewski for the quite response and detailed explanation. Is there a way to place the sub-task branch under the story branch? I tried to do that but the drag and drop method did not work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yep that screenshot is exactly the problem.
Right now you have:
Create Story
Create Sub-task
…but both actions are still running in the Feature context, because you never switched the “current issue” to the Story. So Jira happily creates the sub-task under the Feature.
What to change
You need a Branch between those two actions:
Create issue → Story
Branch rule / related issues → Most recently created issue
Inside that branch: Create sub-tasks (or “Create issue” with type Sub-task)
So the structure should look like:
And: Create a new Story
Branch: Most recently created issue
And: Create a new Sub-task
And: Create a new Sub-task
etc.
If “Most recently created issue” doesn’t exist in your DC
Use:
Branch → JQL
key = {{createdIssue.key}}
…and put the sub-task creation inside that branch.
That’s it. Without that branch, “Create sub-task” will always attach to whatever triggered the rule (your Feature).
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.