We use Tasks (not sub-task). We have one Task called "UAT". When a Reporter has a Bug to enter, they use Rules execution to manually trigger the creation of a new UAT Bug. That UAT Bug has logic built into it to assign one of three different labels (ex: Bug-Agency, Bug-CO, Bug-DX) depending on which group the Reporter belongs to.
I need for all of the UAT Bugs with one of the labels (ex: Bug-Agency) opened from a particular UAT Task to link as "related to" to each other (Bugs), and each individual Bug also links as "blocks" against the UAT Task from which it was created.
So:
When an Agency Bug is created (when issue created, with issue type of Task with label "Bug-Agency")
What comes next? Branch on JQL to find its linked UAT Task?
issue IN linkedIssues({{triggerIssue.key}}, "blocks") AND issueType = Task
Or some other way to find its linked UAT Task?
Then find other Bugs linked to that UAT Task -- I'm very stuck here; can't get the correct rules/JQL
And then link all of those Bugs to each other as "related to"
So you end up with:
A UAT Task that has x # of Bugs with one of three distinct labels linking to it as "blocks" -- so the Bugs block the Task (meaning, we won't close the Task until all linked Bugs are closed) and all Bugs with the same label will link to each other as "related to". Doesn't matter at what point in time that the Bug issues are created (ex: days apart from each other with the possibility that other Bugs have been created in between, but those other Bugs have a different label).
All of this is to ultimately write a rule that will add a comment in the UAT Task to announce that all linked blocking Bugs with a specific label are now closed. <-- that seems simple to say but it's been hard for me to execute. HELP! :-)