You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I am trying to create an automation that creates a new issue within a project and within that new issue create two sub-tasks. The issue is created successfully, but I receive errors regarding the sub-task creations: Issue type is a sub-task but parent issue key or id not specified. (issuetype).
Yet in the automation rule I have the parent issue set as "Current Issue". How do I get the automation to create the sub-tasks within the issue that is created?
Thank you,
Hello @Alicia Simon
You can use a smart value to set the Parent of the subtasks. Example:
Because you are created multiple subtasks I would recommend you do this:
After the creation of the parent issue and before creating the first subtask:
1. Add a Re-Fetch Issue action to ensure the parent issue creation has completed.
2. Add a Create Variable action to store the key of the created parent. The value you want to store is {{createdIssue.key}}
Then, in the Create Issue actions where you are creating Subtasks, set the Parent Issue field to the smart value for the Variable you created.
Hi @Trudy Claspill ,
I tried your suggestion and while it made sense, the result I got is confusing.
Instead of creating one issue with two sub-tasks, the rule created two new issues, each with the first sub-task and also two new sub-tasks under unrelated existing issues (68 & 41).
I also receive an error regarding creating the second sub-task of the rule.
Results:
Here is what I have in the rule (if there's a better way to show, let me know).
I'm beginning to think I just need to create individual issues and not worry about sub-tasks, but I was hoping to keep the board cleaner this way.
I appreciate your help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Alicia Simon
The unexpected results have to do with your trigger.
In your Scheduled trigger you have included a JQL. When you include a JQL in your Scheduled trigger you are telling the Automation that those are the issues you want to operate against. The steps in the automation will be executed for each issue returned by that JQL.
Since your JQL found two matching issues, it will loop through all the actions in the rule twice; once for each issue found.
I don't think you want that. If you think you do then I have missed something in you explanation, and can you please explain how creating a new issue and subtasks relates to the issues you are selecting with JQL?
If indeed you don't want that, then remove the JQL from the trigger and try running the rule again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have tried to create it without the run a JQL box checked but I always get an error. In this case here is the error I get.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Alicia,
It is the Re-fetch issue data action that is causing that error. Try removing that.
I thought it would be needed after a Create Issue action, but I guess it is not.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have progress! The only thing is the second sub-task has not been created and I get the following error. I do have the sub-task set to the correct project, Ranches.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After creating the parent task can you add a Log action to print the issue key to the Audit Log?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I added in the log action, but then get the "Project or issue type not set" even though the project IS set.
I've given up. I don't' understand why it's not simple to just create a new task, create a new sub-task, then create a second sub-task. The amount of time wasted is pointless and I'm just using two automations to have separate task created.
Thank you for your help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am sorry this has been difficult.
I found a simpler way to do this. There is an action that I had not noticed until recently - Create Subtask.
I tested this in both a Company Managed and a Team Managed project and it worked to create the issue and create multiple subtasks under the newly created issue.
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.