Jira Automation - Create a sub-task when a sub-task is marked as 'done'

Stuart Capel - London
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 1, 2020

Hi!

I feel like I'm missing something with the way Jira automation rules work.

I have a Service Desk and I want to create a rule so that when a particular request type is raised it creates a sub-task. Then when that sub-task is marked as done I want another sub-task to be created.

So I'll have a service desk request (new supplier) and when someone raises it, a new sub task will be created and assigned to them (negotiate Ts & Cs) and then when that sub-task is marked as 'done' another sub-task is created (sign contract).

Any help much appreciated

2 answers

1 accepted

1 vote
Answer accepted
Mykenna Cepek
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.
March 7, 2022

I'm noticing a few problems in the rule you posted on 6-Mar-2022.

  • Early in the rule, you should probably use a conditional to check the Issue Type. You can only create Subtasks on standard issue types (e.g. Story, Task, etc). Based on the trigger, this rule will run whenever any issue of ANY type is created in the project (e.g. Epic, Story).  It sounds like you want this rule to continue only when a Subtask is created. Admittedly, the JQL check against the Summary will help, but it's a loose check. Adding that conditional will prevent certain errors in your rule.
  • The "Create new subtask" action is outside of the "For Parent" branch, but I think you want it to execute inside that branch. Then the "current issue" will be changed to the parent of the triggering Subtask, and that's the context you need when creating your additional Subtask.

Hope that helps!

Stuart Capel - London
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 7, 2022

Thanks @Mykenna Cepek 

I thought I had tried moving the action under that side of the branch but you were right and it worked! 

Good shout on tightening up the criteria now that it's working, I will do

 

Thanks again :)

0 votes
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 1, 2020

Hi Stuart,

You should be able to do that with Automation For Jira. Here's some infromation to get you started. Once you have a rule started, feel free to post back here for additional help.

There are two types of automation:

  • Global: In the Free version, you get 100 executions per product, per month
  • Project: In all versions, you get unlimited executions per month

Automation Basics: https://www.atlassian.com/software/jira/guides/expand-jira/automation

You can do this via global rules to apply to all projects also. You'll need to be a Jira Admin/Site Admin, go to Jira Settings > System > Automation Rules (left-hand menu).

For more on using Automation For Jira see these help pages.

Stuart Capel - London
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 1, 2020

Thanks John,

I've got quite a few rules in production that work well.

I only want the rule to apply to one project.

the automations we have set up save a lot of time creating Sub-tasks but they are all triggered from the creation of the issue in the service desk.

I've tried branching to use 'for most recently created issue'

If: status equals Done

But that didn't work. Any pointers would be much appreciated

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 1, 2020

Can have the rule only apply to one project.

Can you share the rule you have so far? And what's not working about it?

Stuart Capel March 6, 2022

Thanks @John Funk 

Bit of a delay but still need to work this out. My automation looks like this 

Capture.PNG

Then the log gives me this

Capture.PNG

I want to create a sub-task, it works fine for task but gives the issue in the logs above when I try and do it for sub-task

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 7, 2022

Hi @Stuart Capel - London 

Thanks for the screenshot.  I can see that the action of the automation rule is attempting to create a subtask on an existing subtask, which is why it's failing to work. 

Try instead to place that "Then: Create a new" subtask action so that it's nested under the "For Parent" branch instead.  This should let that issue be created as a subtask of that parent issue then.

Stuart Capel - London
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 7, 2022

Thank you @Andy Heinzer 

I thought I had tried that, and Mykenna advised the same - you are both right!

Excellent, I'm very pleased it worked :)

Stuart Capel - London
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 7, 2022

@Andy Heinzer - out of interest, do you know how long the "For Parent" branch has been a feature? Has it always been there?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events