Hi community,
I'm trying to set up an automation rule called "Parent Done" in a Jira Software space (Business OPS). Here's what I need:
**Goal:**
A parent task has 5 subtasks. I only want the parent to transition to Done when TWO specific subtasks are both marked Done:
- "Add Binom Links to Posts"
- "Campaign Creation"
The other 3 subtasks (SEO Keyword Research, Post Creation, Binom Link Creation) should be ignored by this rule.
---
**What we have tried:**
1. **JQL condition** (outside branch) with `issueFunction in subtasksOf(...)` → Failed. issueFunction not supported or permission issue.
2. **Smart values conditions** with `{{issue.parent.subtasks.filter(summary == "Campaign Creation").first.status.name}}` → The filter returned empty/null, condition never passed.
3. **Related work items condition → All match JQL** inside a For: Parent branch with `summary in ("Add Binom Links to Posts", "Campaign Creation") AND statusCategory = Done` → Failed because it checks ALL subtasks of the parent against the JQL, not just those two.
4. **Related work items condition → Are equal to 2** inside a For: Parent branch → No JQL field available with this option, so can't filter by summary.
**Current rule structure:**
- Trigger: Work item transitioned to Done
- If: `{{issue.status.name}}` equals Done
- BRANCH: For Parent
- If: [condition that works??]
- Then: Transition work item to Done
What condition should I use inside the parent branch to check that ONLY those two specific subtasks are both Done?
Thank you!
Hello @Yasmina Rodriguez
Welcome to the Atlassian community.
Based on the rule structure you have shown it appears that you are trying to automatically transition the parent issue to Done when two specific subtasks are Done.
How do you identify the two specific subtasks that need to be Done? Are there keywords in the Summary of each subtask? Is that identification method going to work for across items that have subtasks, or does the identification information change?
Yes, and...to the suggestions from Trudy:
Where did you read about a filter() function for smart value lists? That one does not exist for Atlassian automation rules.
And, it is unlikely the {{issue.parent.subtasks}} has any data because:
As alternatives, one could use either long-format iteration and list filtering, or better still, use an inline-format iteration with the match() function to check the subtasks' Summary field.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy and @Trudy Claspill, thank you for the clarification! To answer your questions:
Yes, the two subtasks are identified by keywords in their Summary: 'Add Binom Links to Posts' and 'Campaign Creation'. This identification will be consistent across all parent issues that use this workflow.
Could you provide the exact syntax for the inline-format iteration with match() function to check that both subtasks are Done?
Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To test both of those conditions at once (i.e., the Summary and Status), I recommend using JQL instead of list iteration.
For example, assuming the trigger issue is the parent, you could try a Related Work Items Condition, or a Lookup Work Items and then check the count returned:
parent = {{triggerIssue.key}}
AND issueType=SubTask
AND statusCategory != Done
AND (
summary ~ "\"Add Binom Links to Posts\""
OR summary ~ "\"Campaign Creation\""
)
Please note I inverted the statusCategory check, so you want to check that none were found.
I recommend testing that JQL outside of a rule with an example issue to confirm the values / types match your space.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Bill Sheboy now I understand why your tag is "Rising Star".
I followed your instructions and finally it was sorted.
Thank you so much!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Bill Sheboy I was testing all the conditions, and every time that a subtask is set as done the parent is marked as done. this is my workflow:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please post images of your current complete rule and the audit log details showing the rule execution. That context may help explain what you are observing.
And...did you try the JQL outside of the rule with an example work item to confirm the types, etc. are correct for your Jira space?
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy, please find the rule and audit log attached. I did test the JQL outside the rule in Jira's issue search but it did not return the correct results. Audit Log
Could you help me understand what might be wrong with the JQL for our space?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Yasmina Rodriguez
You provided a link for your Audit Log, but we don't have access to your instance. Please provide a screen image of all the details in the log from the execution of the rule. Make sure to click all the ">" characters to the right of the messages in the log to expand on the details.
In what way is your JQL returning the wrong results when you test it? Can you provide a screen image of the issue you used in that test in the "parent =..." portion of the JQL? Is the actual issue type name of your subtasks "Subtask" or "Sub-task" or something else?
Do I understand that what you are trying to do is automatically transition the parent issue when the two specified subtasks are done? And you want to check this each time a subtask changes to done? If so, your rule needs some changes.
1. After the trigger, add a condition to check if the Issue Type of the trigger issue is Subtask.
2. Within the branch you need to get rid of the "If no subtasks match" condition. Instead add a Lookup Work Items action and a condition to check how many results you get. In my example below replace XXX and YYY with the summary text you are using in your current JQL. In this case you are executing the JQL to confirm that the two specified subtasks are set to Done. When they are you would expect the JQL to find 2 issues, which is what is testing in the condition that checks {{lookupIssues.size}} next.
3. Check that the status of the Parent issue is not already Done, and transition it to Done if that is true.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.