Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,554,311
Community Members
 
Community Events
184
Community Groups

Issue with Sub-tasks automation need parent ID error

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).

JIRA-Ranches MonthlyFinancialsError.png

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, 

1 answer

2 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 10, 2023

Hello @Alicia Simon 

You can use a smart value to set the Parent of the subtasks. Example:

Screen Shot 2023-05-10 at 2.40.39 PM.png

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:

JIRA-AutoSubs8.pngJIRA-AutoSubs7.png

 

JIRA-AutoSubs1.png

Here is what I have in the rule (if there's a better way to show, let me know).

JIRA-AutoSubs2.png

JIRA-AutoSubs3.png

JIRA-AutoSubs4.pngJIRA-AutoSubs5.png

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. 

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 11, 2023

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.

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.

 

JIRA-AutoSubs9.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 11, 2023

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.

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. 

JIRA-AutoSubs10.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 11, 2023

After creating the parent task can you add a Log action to print the issue key to the Audit Log?

Screen Shot 2023-05-11 at 11.00.42 AM.png

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. 

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 24, 2023

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.

Screen Shot 2023-05-24 at 2.45.39 PM.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events