How to create new issue with sub-tasks when creating a new sprint

Matt Comstock January 4, 2020

We have a standard set of tasks and sub-tasks that are created whenever a new sprint is created.  I would like to automate this, it appears that it is straightforward.  I must be missing something obvious.

1. When Sprint is created 

2. Then Create Issue

3. And Create 1 Sub-Task

When trying to publish the rule.  I receive the following error.  I've tried adding a branch with the "issues in the sprint" value selected, but this does not work.

Also, if I remove the create sub-task then the rule works fine.

I have added a screenshot.

Any Ideas where I am going wrong?

Error

  • The rule has been configured with components that require issues to be provided by the trigger. To run these components you must add a branch for this sprint or JQL. The following components require issues: Create sub-tasks

Thank you.  Matt

2020-01-04_12-23-32.png

3 answers

1 accepted

7 votes
Answer accepted
wwalser
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 5, 2020

Matt,

Just quickly, here is what you want:

Screen Shot 2020-01-06 at 2.54.15 pm.png

I’ll also explain in case that’s helpful to others or to yourself in the future.

It helps to understand what is happening as a chain of components execute in an Automation. As each step executes, it writes any relevant details into what we call the “context object”. This is the object from which smart values are pulled.

Most automations trigger on some manipulation of an issue, so it is often the case that {{issue}} exists within this context object. Lots of actions implicitly read this {{issue}} value to understand what issue to operate on.

In your case, because the automation isn’t triggered on an issue, there is no {{issue}} in context. Because of this, the Create Sub-task step doesn’t know where to create the sub-task.

You may think that the Create Issue action should push a value into {{issue}}, but it doesn’t. Instead, it pushes a value into {{createdIssue}}. My screenshot above works around this by using a branch component on `most recently created issue`. Branches maintain their own context and this specific one effectively takes the value on {{createdIssue}} and treats it as the {{issue}} for all of it components.

Hope that helps,
Wes

Matt Comstock January 6, 2020

Wes, all of that makes sense.  Thank you for your quick reply.  I applied the suggested changes and it work perfectly.

Great product, by the way.

Like LyzX likes this
0 votes
LyzX
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!
February 24, 2021

Matt, Thanks for the tip!

0 votes
Rikin Patel May 7, 2020

Thanks...!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events