I have template stories with sub-tasks on them for standardized work. When any new story is created I'd like to match it's title to our template stories. If the title matches then I'd like to clone the sub-tasks from the template story onto the newly created story.
For some reason the "For Sub-tasks" portion of my automation appears to be running against the triggering story rather than the Lookup story.
Any help would be much appreciated:
Hi @Aaron Eden -- Welcome to the Atlassian Community!
To which issue are you setting the parent of the new subtasks? From what you describe, it seems the parent is not selected or is setting to the trigger issue.
If you want it to be a specific one, that key will need to be provided in the Clone Issue action.
Kind regards,
Bill
Ahh yes, I should have included that detail and thanks for the speedy reply. The Clone Issue task doesn't ever seem to execute. It always says there are no Sub-tasks, but I've confirmed my templates include sub-tasks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah...it is trying to branch over subtasks of the trigger issue, but you want them to be from the source issue found by the lookup.
In that case, change your branch type to JQL. If that variable is the key to your template story, the branch JQL could be this:
parent = {{templateStory}} AND issueType = "Sub-task"
Please check that to confirm the types and variable match your site.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
EDIT:
@Bill Sheboy shared the same answer faster than me ;-)
I'll just leave mine here for posterity.
Hello @Aaron Eden
Welcome to the Atlassian community.
What are the details of the two Create Variable actions?
One problem with your rule is that at the point you are using the For Subtasks branch, the focus of the rule is still the triggering issue. You have not changed the focus of the rule to the template issue. Subsequently the rule can't find the subtasks to Clone. This is supported by the message in the log file that says "No related issues could be found."
Additionally this condition:
...is executing against the trigger issue. Subsequently the criteria
summary ~ "\"{{issue.summary}}\""
...is pointless because of course the Summary of the trigger issue will match {{issue.summary}}
I think what you need to do is use that JQL in a Lookup Issues action instead to find the template issue:
project=ICSAUTO and issuetype=Story and summary~"\"{{issue.summary}}\"" and key != {{issue.key}}
The Lookup will then find an other issue in the project that has a matching summary, besides the issue that was just created.
However, is it possible that this template will be used multiple times? Might there be other issues also in the project besides the newly created issue and the template that have the same Summary? If so, you might need to add more criteria to the JQL to find just the template issue.
To ensure you have found one and only one matching issue you should add a Smart Value Condition after the Lookup Issues action to check the following:
Smart value: {{lookupIssues.size|0}}
condition: equals
Value: 1
That will ensure you have found just one isue.
After that you can use a For Related Issues: JQL branch to iterate over the subtasks of the template issue with a JQL similar to this:
parent={{lookupIssues.first.key}}
That will iterate over all the child issues of the issue found by the Lookup Issues action.
Within that branch you would execute your Clone action and set the parent to Trigger Issue. You would not reference the {{lookupIssues}} object within the Clone action.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.