Error running basic automation on next-gen project
Asked by Adam Foot:

The goal is to create an automation that when run creates a Task with Subtasks.

To try \& achieve this, I've created a very simple automation task configured as follows:

**Create a new issue in:**

Project: Test

Issue type: Task

Summary: task test

+

**Create a new issue in:**

Project: Test

Issue type: Subtask

Parent Issue: Current issue

Summary: subtask test

However when run, it shows the below output including an error at the subtask step:

**Action details:**   
Create issue  
Issues created successfully  
TEST-32  
Create issue  
Error creating issue  
Issue type is a sub-task but parent issue key or id not specified. (issuetype)

Please advise what the problem is here?

Thanks


Answers:
author: Ash Pitt
body: Hey [@Adam Foot](/t5/user/viewprofilepage/user-id/4200444)

I believe you would want to select the "Create sub tasks" action.

Basically

* When: Issue created
* Condition: Issue type equals task
* Action: Then create x sub tasks

That should do it :)

![automation.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/122987iB9645924486A0E7A/image-dimensions/439x381?v=v2 "automation.PNG")

comments: author: Adam Foot
body: Thanks [@Ash Pitt](/t5/user/viewprofilepage/user-id/4180469) for the prompt reply.

I did see that option, but the problem I encountered is that it doesn't let you set additional properties on the create sub-tasks action page e.g. assignee.

When I click on add fields it takes me back to the standard create issue page where I had originally configured the subtasks \& therefore have the errors.

Here is a snip of what I'm trying to achieve - it begins off a scheduled time trigger:

![Capture2.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/122992iB6B55609D9CF44B4/image-size/large?v=v2&px=999 "Capture2.PNG")

Based on the above, would there still need to be conditions added?

Thanks


author: Ash Pitt
body: Hello again [@Adam Foot](/t5/user/viewprofilepage/user-id/4200444)

I only added in the condition to specific adding the task type only, so it's not required really, that's just how I'd filter it down to "task only".

To assign a user I just used the "add fields" part of the sub-task automation and was able to automate the assignee to the reporter. There are plenty of other options though!

So it looks like you're on the right path, just play around with the "Add fields" options.

![auto3.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/122994i0D851AF6ADD5F37E/image-dimensions/503x265?v=v2 "auto3.PNG")

![auto4.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/122995iE5B3D1109F01796E/image-dimensions/499x245?v=v2 "auto4.PNG")

IMO to test the function out first (if you haven't already) do the automation triggers based on when the issue is created, then when happy, flick to scheduling.

Cheers

Ash


author: Adam Foot
body: Hi [@Ash Pitt](/t5/user/viewprofilepage/user-id/4180469) I'm unfortunately still getting the error when running the very basic automation shown in my previous post. The error details are below:

![Capture3.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/123001i0ECDF2CBA07F236B/image-size/large?v=v2&px=999 "Capture3.PNG")Any ideas?

Thanks


author: Ash Pitt
body: Ok so with scheduling I think you will need to use the branch rule function.

In my example below I wanted to have a task created with sub tasks every day, so I set it up similar to what you did, however used the branching rule for the most recently created issue (which is that task) to create 2 sub tasks.

I think that will sort you out :)

![branch rule.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/123003i13688C70D32CD3CB/image-size/large?v=v2&px=999 "branch rule.PNG")


author: Adam Foot
body: Thanks [@Ash Pitt](/t5/user/viewprofilepage/user-id/4180469) that worked!

Lastly, even though the Assignee is specified in the rules for both the Task \& Subtask, it's still making "Automation for Jira" the Assignee.

Any ideas on how to solve that one?

<br />

Thanks


author: Ash Pitt
body: Yep I have ideas :)

Within the task/sub task settings you can **choose the fields to set**, so in that case I chose the assignee and the reporter (though it should work for whatever fields you have set up the require an assignee) - then you just specify who you want it to be assigned to.

Works a treat for me.

![reporter.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/123163iC29B0D77393A5011/image-dimensions/747x371?v=v2 "reporter.PNG")


author: Adam Foot
body: Hi [@Ash Pitt](/t5/user/viewprofilepage/user-id/4180469) that's a different result from what I get.

I have it set the same, for the assignee to be x user during the create a new Task \& Subtask. However it ends up being "Automation for Jira" as shown below:

![assignee.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/123295i6B8C2393684411FF/image-size/large?v=v2&px=999 "assignee.PNG")

I did notice that the Actor is Automation for Jira under Rule Details, but I assumed this is still achievable without changing that:

![actor.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/123296iDDB3C6FD19588F84/image-size/large?v=v2&px=999 "actor.PNG")What do you think?  

Thanks


author: Ash Pitt
body: Merry Christmas [@Adam Foot](/t5/user/viewprofilepage/user-id/4200444)

Changing the actor I think works, however there is caution to be taken with that as well.

![actor.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/123468i0FEB95EB2F8D7C46/image-dimensions/465x215?v=v2 "actor.PNG")

However it does work :) note the NGD-50 is the one i set up as me being the actor.

![actor2.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/123469i8986C0454A735400/image-dimensions/506x252?v=v2 "actor2.PNG")Hopefully that (now) has helped you get cracking with automation!

Cheers and a happy new year

Ash


author: Adam Foot
body: Hi [@Ash Pitt](/t5/user/viewprofilepage/user-id/4180469) , even though the assignee is set to be user_b, it's making the assignee for both the tasks \& subtasks whoever the "actor" is in the automation e.g. if I change the actor to myself, it makes me the assignee for all tasks \& subtasks in the automation. If I change the actor to Automation for Jira, then that becomes the assignee.

This is despite the assignee being specifically set in each rule of the automation e.g. create subtask \& set the assignee to be user_b.

Any ideas?

Thanks


author: Bill Sheboy
body: Hi [@Adam Foot](/t5/user/viewprofilepage/user-id/4200444)

As you have been improving your rule, please consider posting a new image of the current rule. That may help uncover the issue with the edit and the assignment.

Thanks, and best regards,

Bill


author: Adam Foot
body: As suggested, here are some screenshots of the automation:

![s1.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/123724i3BD4B8C90F8C0BF5/image-size/large?v=v2&px=999 "s1.PNG")

![s2.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/123727i7818A8557FC44B3F/image-size/large?v=v2&px=999 "s2.PNG")

Results in the assignee being Automation for Jira:

![s3.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/123726i347B0F08BD758388/image-size/large?v=v2&px=999 "s3.PNG")


author: Bill Sheboy
body: Yup, that looks like a defect. When you look at the individual task's history does it show as only assigned once to the automation user?

I looked in the public backlogs and didn't see a defect for this, so if you are on a paid license I suggest submitting a defect for this, and then post back here what you learn from the support team:

<https://support.atlassian.com/contact/#/>


author: Adam Foot
body: Thanks Bill, the assignee was just caused by a Workflow issue.


Tags: schedule