Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

JIRA automation - need help to create tasks upon closing the previous task

I am new to JIRA automation. I have a set of tasks that need to happen upon a trigger. Each of these tasks are sequential and need an owner assigned as soon as the previous task in line is complete. Could you please tell me if the below is feasible through JIRA automation?

Logic:

1. Create a trigger to create an issue when a user types certain key words in the subject of the email email summary 

2. Create sub task 1 and auto assign it to member 1

3. Once sub task 1 is complete create sub task 2 and  auto assign to member 2 

4. Once sub task 2 is complete create sub task 3 and auto assign it to member 3

5. Once sub task 3 is complete, close the parent issue and notify via email 

1 answer

1 accepted

2 votes
Answer accepted
Ivan Lima Community Leader Oct 31, 2021

Hi @Amroz. Welcome to the Atlassian Community!

I'm pretty sure it's possible to create something like you described. However, could you please clarify your use case so we can better assist you?

1. Create a trigger to create an issue when a user types certain key words in the subject of the email email summary 

I suppose you want to "scan" the summary field to look for specific strings and create a sub-task if the keywords/strings match your condition. Is it when the ticket gets created or even when the summary field is updated?

Why couldn't you create all sub-tasks at once? You still can have automation to notify users upon completion of the latest sub-task. Also, what if a new sub-task gets manually created after all? Sometimes, it's worth exercising a few scenarios to gain insights into the bigger picture before working on the automation.

Since you're new to Jira automation, I'd suggest looking at the following links to learn more.

In the automation template library, you will find the most popular ones, including Auto close parent issue when all sub-tasks are done (sync) and Automatically add 3 sub-tasks on issue creation.

Cheers.

@Ivan Lima  Thank you for taking time to respond to my question. The reason I want to create sub-tasks sequentially is because each of these tasks have a different owner and want to notify owner 2 (for sub task 2) once the owner 1 (completes sub task 1). I want to automate this process to be enable something as shown below 

The rule doesn't execute after the "Sub-Task 1" is created. I know this is not set up the best way, but the snippet below pretty much summarizes my use case (i.e. New Vendor Set Up)

JiraAutomation-help.PNG

In this case, I believe it's better to break it into two rules; otherwise, it can get complicated to troubleshoot and maintain. I'm sure you can do what you want using something like:

Rule #1

  • When: Issue created
  • if block: all-match 
    • Request type equals <Your Request Type>
    • Summary contains <Your string>
    • Sub-tasks not present
    • <Any other condition>
  • Then: Create a new Sub-task

Rule #2

  • When: Issue transitioned To Done.
  • For Parent (branch rule / related issues)
    • If: Compare two values - Check if: {{issue.subtasks.size}} equals 1
    • Then: Create a new Sub-task
  • For Parent (branch rule / related issues)
    • If: Compare two values - Check if: {{issue.subtasks.size}} equals 2
    • And: Sub-task match status = Done.
    • Then: Create a new Sub-task

You might find alternative ways to achieve it using automation for Jira, but the rules above should do the trick. You still have to add other actions, such as sending emails, but once you assign the sub-task, your notification schema takes care of that.

@Ivan Lima  - Thank you so much for a detailed explanation. My rule #1 works and creates a sub-task as expected but my rule #2 doesn't get triggered

rule1.PNG

rule2.PNG

Ivan Lima Community Leader Nov 03, 2021

Rule #1 (example)

ac-1.png For the first rule, you can have your "If block" with all conditions you need. You can add conditions to your existing block. It should make it cleaner—also, fewer steps to execute, making it easier to troubleshoot by checking the automation rule audit log.

Rule #2(example)

 ac-2.png

For the "When" trigger, you should set TO, not FROM

You can create a new sub-task; you don't need to specify the number in this case. It shouldn't make any difference, but you can select "add fields" inside your action "Create sub-tasks" and include additional fields such as the assignee, as you mentioned before.

ac-3.png

For the second part of rule #2, you need to check whether the status is done; otherwise, it will create all subtasks at once, which you don't want to happen.

I hope that helps.

Like Amroz likes this

@Ivan Lima  Thanks a lot. This worked like a charm. I truly appreciate your help here! :)

Like Ivan Lima likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Jira Service Management

JSM Jira Automation: How to Send SLA Breached Notifications

Hi Everyone, In   this tutorial,  we will show you how you can monitor an SLA, and send notifications before or after the SLA has been breached.   SLA Threshold Trigger The SLA t...

673 views 5 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you