Forums

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

Automation - Compiling unfinished subtask owners in a string

Tom
Contributor
July 3, 2025

We work in a multi-team environment with lots of interdependencies.   I'd like to have a field on a story/bug that has an up-to-date list of everyone who has a subtask remaining on the main story/bug ticket.

Example

  • Story PROJ-1011
    • Subtask PROJ-1022 assigned to Bob which is in "DONE" Status
    • Subtask PROJ-1027 assigned to Tim which is in "DONE" Status
    • Subtask PROJ-1035 assigned to Bob which is in "IN PROGRESS" Status
    • Subtask PROJ-1037 assigned to Bob which is in "TO DO" status
    • Subtask PROJ-1022 assigned to Sue which is in "TO DO" Status

Assuming we had the field "Notes" on the Story, I'd like the Notes string to be "Bob, Sue"

This excludes:

  • DONE status items
  • Dedupes Bob from appearing twice. (this part is optional, if we can get everything else working and have some duplication that's still a victory)

 

The trigger events are anytime a subtask class issue is created, updated or assigned, to cause a rebuild of the list on the parent story/bug.

I've had success with getting the string built with a branch to the parent and then a field update action with:

      {{issue.subtasks.assignee.emailAddress.substringBefore("@").join(", ")}}

But I've had no success after many tries at not including the Done items or deduping.  Any help or pointers would be appreciated.

 

Current setup:

  • Trigger: Multi-trigger on create/assigned/closed
  • Condition: Subtask class issue
  • Branch: Parent
  • Lookup issues: issueFunction in subtasksOf("key={{issue.key}}") AND NOT Status = Done
  • Edit field: {{issue.subtasks.assignee.emailAddress.substringBefore("@").join(", ")}}

1 answer

0 votes
Bill Sheboy
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.
July 3, 2025

Hi @Tom 

Removing the duplicates may be done using the distinct list function:

https://confluence.atlassian.com/automation/jira-smart-values-lists-993924868.html#Jirasmartvalueslists-list.distinctlist.distinct

Your current rule is triggered on a change to a Subtask, and so the lookup issues action should only return Subtasks which are siblings to the trigger issue, and not Done.

Once you have made that adjustment, please add the distinct before you join(", ") the values together.

Kind regards,
Bill

Tom
Contributor
July 7, 2025

@Bill Sheboy 

Thanks for that fast reply. Holiday weekend over and I'm back to it this afternoon.

!!The distinct worked like a charm, thank you for that!

The part to eliminate the Done subtasks from the compiled string isn't quite making sese to me.  Sorry for being dense.

When you say "Your current rule is triggered on a change to a Subtask, and so the lookup issues action should only return Subtasks which are siblings to the trigger issue, and not Done."

My lookup is "issueFunction in subtasksOf("key={{issue.key}}") AND NOT Status = Done"  

I'm just not understanding what you suggest changing as this is not working for me and still results in a string with the names from all subtasks including the done ones.

 

Edit to add:

I've tried that query several different ways and while in Jira search it returns the correct set of subtasks, when used in automation, any filtering seems ignored other than the subtasksOf().  Put in filters by subtask type, status, etc.  Put them before and after the subtasksOf().  Every time, everything but the subtasksOf() is ignored.  Weird stuff.

Suggest an answer

Log in or Sign up to answer