Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,559,866
Community Members
 
Community Events
185
Community Groups

How to automatically create a sub-task when other two sub-tasks are DONE under the same parent.

Hi guys,

 

My workflow system is like the following:

1. When a Story is created, two sub-tasks are automatically created under that Story.

2. When BOTH of those two sub-tasks are marked as DONE, another new sub-task should be automatically created under the same Story.

 

Here, the most important point is:

Both of two sub-tasks MUST be DONE to get the next new sub-task. If only one of those two sub-tasks is done, new sub-task should not be created.

 

Thank you so much!

1 answer

1 vote
Heather Ronnebeck
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 26, 2023

You can do this with Jira's Automation feature in the project if you have project admin. The automation rule would be triggered upon transition of a ticket. 

I'm not sure the exact configuration, but basically you'll need to trigger it when sub-tasks close, and have it look in the parent ticket (I think with branches and if statements) to ensure that there are no open sub-tasks. If there are no open sub-tasks, then create sub-task 3. If there are open sub-tasks, do nothing. 

That's the jest of how the rule would work. The actual implementation on it, I'd need to spend more time to give you the exact config. 

This guide here should also help. https://support.atlassian.com/cloud-automation/docs/jira-cloud-automation/

Can you provide me more details about your method with something like snapshots of automation?

Heather Ronnebeck
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 27, 2023

I can't do snapshots, but maybe this will help better:

Automation rule #1: Creating two sub-tasks when a story ticket is created

  1. Go to your Jira project and click on the "Settings" gear icon in the bottom left corner of the screen.
  2. Select "Automation" from the menu on the left-hand side of the screen.
  3. Click the "Create rule" button.
  4. Give your rule a name, such as "Create two sub-tasks when a Story is created."
  5. Under the "If" section, select "Issue created" from the "When" dropdown menu, and select "Story" from the "Issue type" dropdown menu.
  6. Under the "Then" section, click "Add action."
  7. Select "Create issue" from the list of available actions.
  8. Give your first sub-task a name and select "Sub-task" as the issue type.
  9. Under the "Project" dropdown, select your current project.
  10. Under the "Parent issue" dropdown, select "Current issue" to link the new sub-task to the current Story.
  11. Under the "Fields" section, set the appropriate fields for the new sub-task (e.g. assignee, due date, description, etc.).
  12. Click "Save" to save your new rule.
  13. Repeat steps 7-12 to create the second sub-task.

Now, whenever a Story is created, two sub-tasks will automatically be created under that Story.

Automation rule #2: Create third sub-task when two sub-tasks are completed

  1. Go to your Jira project and click on the "Settings" gear icon in the bottom left corner of the screen.
  2. Select "Automation" from the menu on the left-hand side of the screen.
  3. Click the "Create rule" button.
  4. Give your rule a name, such as "Create third sub-task when two sub-tasks are completed."
  5. Under the "If" section, select "Issue transitioned" from the "When" dropdown menu, and select "Sub-task" from the "Issue type" dropdown menu.
  6. Click "Add condition" and select "Compare condition."
  7. In the first dropdown, select "Number of linked issues" and set it to "equals" and "2."
  8. In the second dropdown, select "Number of linked issues with specified JQL" and enter the following JQL query: "status = Done"
  9. Under the "Then" section, click "Add action."
  10. Select "Create issue" from the list of available actions.
  11. Give your new sub-task a name and select "Sub-task" as the issue type.
  12. Under the "Project" dropdown, select your current project.
  13. Under the "Parent issue" dropdown, select "triggerIssue.parent" to link the new sub-task to the current Story.
  14. Under the "Fields" section, set the appropriate fields for the new sub-task (e.g. assignee, due date, description, etc.).
  15. Click "Save" to save your new rule.

Now, whenever two sub-tasks are marked as "Done" under a Story, a third sub-task will automatically be created under the same Story.

Thank you for all the details? Heather!

 

Since I know how to the Automation rule #1, let’s focus on rule #2.

For step 6 and 7 above, you mentioned “Compare Condition”. But according to my JIRA automation components, there is no “Compare Condition”. There is “Advanced Compare Condition” instead, but when I click on it, the first value does not have any “Dropdown”, only JQL version typing system.

I am not sure if we are using the same system, but anyways, is there a way to make it work using “Advanced Compare Condition”? Or is there a way to find “Compare Condition” that you mentioned?

Heather Ronnebeck
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 28, 2023

My apologies @Kyung Park I meant to select the "Related Issues Condition"

Screenshot 2023-04-28 at 8.18.49 AM.png

Hi Heather,

 

Now I have another question. So, according to your automation steps, where is step for fields of those two subtasks?

when those two subtasks get created after a Story is created, those two have different specific Labels, and those need to be called into the automation.

Heather Ronnebeck
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 29, 2023

Hi @Kyung Park 

You can always add in a step 16 or more for editing the newly created issue and making the edits needed to have the specific labels. 

Hi Heather,

 

I actually meant specific Labels for those TWO subtasks that need to be done together, not newly created issue.

For example, your step 5 mentions about “Issue Transitioned”, so I understand I can make it like: “When” something is done.

But step 7 just says that “Number of linked issues” is equal to “2”. Where do I put information about those “two” subtasks? For instance, those two subtasks have specific Labels. And I think the specific Labels should be called for “Number of linked issues” stuff.

Heather Ronnebeck
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 01, 2023

In the screenshot I shared, you can always call out additional requirements by adding more conditions. So you can add in the fact that labels have to equal certain terms. 

Hi Heather,

 

Thank you for your help, but another question is:

In related Issues Condition, Condition only has 4 options like the following:

1.png

 

There is no "Are Greater Than" under Condition dropdown option. Is there any way to make that option?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events