Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation fails to create Sub-Task inside a Task

Ali Zalzar October 4, 2022

I've been trying to create a Task with 3 Sub-Task through Automation but I keep getting the following error:

 

Action details:
Create issue
Issues created successfully
TP-108
Create issue
Error creating issue
Issue type is a sub-task but parent issue key or id not specified. (issuetype)
SC log.jpg
Here is my rule(s):
SC.png
Here is my sub-task Action:
rule.jpg

3 answers

1 accepted

3 votes
Answer accepted
Martin Bayer [MoroSystems, s.r.o.]
Community Champion
October 4, 2022

Hi @Ali Zalzar , welcome on the community :). You can try to use smart value {{createdIssue}}. It should store the last created issue in the rule:

Screen Shot 2022-10-04 at 14.11.09.png

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/ -> search for "{{createdIssue}}"

Ali Zalzar October 4, 2022

Thanks, Martin. Very kind of you. Yea I've been reading about smart values in the documentation but I don't quite understand where do I actually set this {{createdIssue}}? 

do I just put this in the Description? I tried other smart values on Additional fields and it didn't work and got more errors

Martin Bayer [MoroSystems, s.r.o.]
Community Champion
October 4, 2022

No, you need to write it manually to the Parent issue field. Check the screenshot I attached :)

Don Sizemore July 3, 2023

@Martin Bayer [MoroSystems, s.r.o.]thank you for this answer, but I'm getting the same error, and when I attempt to enter {{createdIssue}} in the parent-issue drop-down, it reverts to "Current Issue" (no more free-text entry).

Jira doesn't seem to like {{createdIssue}} or {{createdIssue.key}} in the additional field JSON.

Any pointers most appreciated - thank you.

1 vote
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 4, 2022

The problem is your choice of "current issue" in the sub-task settings.

There is no current issue in a scheduled task, you need to tell the automation which issue you want to create the sub-task(s) in.

0 votes
Aleksandra Bosacka _Deviniti_
Atlassian Partner
October 5, 2022

Hi @Ali Zalzar

If you don’t mind using a plugin, I believe that as an alternative to automation action, you could also use the Issue Templates for Jira app to automatically create tasks with sub-tasks out of predefined templates.

With our app, you can create a repository of re-usable templates and then use them in scheduled automation by defining a specific template in your rule as follows. Thanks to that, you won't need to define the template text in the automation rule directly, but in the template issue which could be more convenient in some cases.

{

“properties”: [{

“key”: “issue.templates.automation”,

“value”: {

“applyTemplate”: “TEMPLATE-1"

}

}]

}

Feel free to ask here in case of any additional questions about the functionality or the required setup.

I’ll be happy to help!

Cheers,

Aleksandra

Suggest an answer

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

Atlassian Community Events