Forums

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

Sub-Task Creation via Automation

Heather Ronnebeck
Community Champion
November 27, 2023

Hey, 

I have several automations that are running on a scheduled cadence. I'm trying to create subtasks as part of the same automation. I have a feeling my branching isn't working as expected, but I could use a hand please. What I've done at a high level is:

  1. Monday AM run automation
  2. Create Task
  3. For most recently created Issue:
    1. Create subtask (with the following fields)
      1. Summary: {{issue.parent.summary}}: Extra part of title
      2. Description: Jargon on description with [{{issue.parent.key}}: {{issue.parent.summary}}|{{issue.parent.url}}] -- This part here doesn't populate It just gives me a : with a link that points to all project issues. 
      3. Due date: {{issue.parent.duedate}}
      4. Assignee: {{issue.parent.assignee}}
      5. Reporter: {{issue.parent.reporter}} -- This one just kills the automation and makes it fail if I do this vs putting in an actual username.
    2. Create Subtask X to X+1 -- Basically do this as many times as needed for the specific automation.

The issue I'm having is that when I do this. The fields aren't being populated if the ticket is being made at all. I can't do trigger issue because the trigger is a scheduled time and not an issue. 

I've also added in multiple re-fetch steps between making the tasks and subtasks to no avail. 

Does anyone have any suggestions I can try? Thanks in advance!

3 answers

3 votes
Heather Ronnebeck
Community Champion
November 27, 2023

Alright... I think I answered my own issue. I'll post it here though. It looks like when doing an automation like this, you want to do 2 things.

1. Use {{issue.fieldname}} not {{issue.parent.fieldname}} in the Create Issue action I mentioned in Step 3.1. 

2. Make sure in the same create issue action in Step 3.1 you have the parent issue set to current issue. 

** Note: Multiple Re-Fetches helps buy time too. 

Thank you though everyone for the help!

Bill Sheboy
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.
November 27, 2023

Hi @Heather Ronnebeck 

Without seeing your rule specifics, I believe you do not need any Re-fetch Issue actions in the rule.  That action is used for a couple of reasons:

  1. When a rule edits the current issue, and wants to use the updated fields later in the same rule, the re-fetch will reload the data before proceeding
  2. When using a trigger like Issue Created, or Issue Field updated for Parent when a move is done with the UI feature.  In that case, there are timing / race-track errors in the automation engine, requiring a slow down and data reload to help.

From what your describe, your rule isn't doing either of those things.

 

Next, have you tried to create all of the sub-tasks with one action, selecting the option to "Add another sub-task"?  That may simplify your rule rather than using separate actions for each sub-task.

Kind regards,
Bill

Like Dave Rosenlund _Trundl_ likes this
Rudy Holtkamp
Community Champion
November 28, 2023

For 3.1.2 you could use the {{createdIssue}} smart value. {{issue.parent.field}} will not work since there is no issue yet created, thus no parent is known and the field is empty.

Like Dave Rosenlund _Trundl_ likes this
Bill Sheboy
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.
November 28, 2023

Hi @Rudy Holtkamp 

That would work outside of the branch shown, and after it issue created in step 2. 

But once inside the branch on "most recently created issue" the smart value {{issue.some field}} will work as expected.

Kind regards,
Bill

Like Dave Rosenlund _Trundl_ likes this
1 vote
Mikael Sandberg
Community Champion
November 27, 2023

Try and remove .parent. from your smart values, {{issue.summary}} should give you the summary for the task that you just created since that is the branch you are on when creating the subtask.

0 votes
Nikola Sormaz
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 16, 2024

Ensure that the variable syntax used (e.g., {{issue.parent.summary}}) is correct and supported by your automation tool. Some tools might require different formatting or specific methods to fetch parent issue details.

Suggest an answer

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

Atlassian Community Events