Forums

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

How can I create an if statement to detect whether a sub task already exists?

Sarah Isaacs
Contributor
January 3, 2025

Hi,

 

I'm using Jira Cloud Team managed project. I only have admin for my project and not global admin. This makes for a complicated board full of workarounds.

I have created an automation that creates a task and sub task once the first task (original task has been completed (done). See Images below. I'd like to add to this automation to only create the task (and its sub tasks) if it doesn't already exist. Is that possible please? Can you help? 

 

 

 

 

 

image.pngimage.pngimage.pngimage.pngimage.png

2 answers

1 vote
Trudy Claspill
Community Champion
April 4, 2025

Hello @Sarah Isaacs 

I have a few questions.

1. The rule is triggered by a transition to Done. Then it checks the Summary of the trigger issue. Then it branches to the trigger issue's Parent. What type of issue will match the trigger and Summary condition; a subtask, a standard (level 0) issue, or an Epic?

In the Parent branch when you create the new issue, in the new issue's Summary field you are referencing the smart value {{issue.epic.summary}}. That would imply that your trigger issue was a subtask, and the branch is to its parent which is a level 0/standard issue type. Is that correct?

2. Assuming that is correct, the purpose of the branch is to create a child issue in the subtask's parent's Epic. Is that correct?

Assuming that is correct I recommend that you insert a Lookup Issue action to see if an issue exists that matches the criteria of having the same Summary as the new issue you would create and is a child of the Epic.

Then check if the results of that Lookup is no issues being found.

Screenshot 2025-04-04 at 2.05.52 PM.png

If no issues are found the rule will proceed into the branch and create the issue.

 

Let me know if you need a more detailed explanation.

Sarah Isaacs
Contributor
April 10, 2025

Hey Trudy,

 

Thanks for the reply, I super appreciate it. 

 

Q1 he rule is triggered by a transition to Done. Then it checks the Summary of the trigger issue. Then it branches to the trigger issue's Parent. What type of issue will match the trigger and Summary condition; a subtask, a standard (level 0) issue, or an Epic? - Answer: a Sub task will contain/match the summary and trigger the branch. So yes correct.

Q2. Assuming that is correct, the purpose of the branch is to create a child issue in the subtask's parent's Epic. Is that correct? - Answer: Yes the branch is so that I can create a task and then sub tasks within the same Epic. The Epic is effectively a Book, so contains all the information - who is working on the book, the title, the type of book and then I populate the tasks and sub tasks with that information every time so that it is copied from one to another. 

Great thanks so much I'll give it a go and see if I can get it to work. Can I also ask: I really want to improve my Jira Knowledge generally and specifically automations can you recommend a way I could do that please? A paid course or something else? I'd like to get a certification or something. In my self taught world I feel i need some big gaps filled. Thanks again.

Trudy Claspill
Community Champion
April 10, 2025

Have you visited the Learning area of the community?

https://community.atlassian.com/learning

There is a lot of free, on-demand training available there. There are also some live learning sessions available.

There are also learning opportunities available through Atlassian Community Events.

https://ace.atlassian.com/

There is a community area here also for focusing on Automation. Reviewing the questions and answering can be very educational.

https://community.atlassian.com/forums/Atlassian-Automation/ct-p/automation

1 vote
Aaron Pavez _ServiceRocket_
Community Champion
January 3, 2025

Hi @Sarah Isaacs 

Can you add this check after the issue type condition?

2025-01-03 10_28_12-Rule builder - Automation - TEAMMANAGED - Jira — Mozilla Firefox.jpg

This should check if a sub-task exists. If it does, then continue with the next actions.

Regards

Sarah Isaacs
Contributor
April 4, 2025

Hey, there anymore answers to this as if the task already exists then I don't want to create another one as then I have duplicate tasks? Is this possible? Do you know @Trudy Claspill , @Bill Sheboy  Thanks in advance.

 

image.png

Suggest an answer

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

Atlassian Community Events