How to get a list of sub-tasks based on a list of parent ids/key

Omar Badran October 25, 2019

I'm trying to figure out how to get a list of sub-tasks given a list of parent ids or keys and the sub-task summary contains certain text.

Each top level issue has a number of sub-tasks.  Each sub-task summary follows a specific naming convention and part of the summary text is the same for each sub-task of each issue.  I'm trying to generate a list of sub-tasks so that I can do a bulk change like setting the FixVersion.

Here is a sample idea using a SQL query

select sub-task where sub-task.parentID in ("xyz1","xyz2","xyz3") and sub-task.summary constains "text substring"

So far I've gotten the following JQL that executes with no errors, but also not getting any results.

project = XYZ AND issuetype = Sub-task AND issueFunction in parentsOf("Key=XYZ")

2 answers

1 vote
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 25, 2019

you mention "given a list of parent ids" so am assuming it is a static list. if so, what about something like this....

issuetype=Sub-task and summary ~"this-text" and parent in (xyz-34, xyz-39, ...)

Omar Badran October 25, 2019

I could have sworn I tried that.  It works.  Thanks!

0 votes
Jack Nolddor _Sweet Bananas_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
October 26, 2019

Hi Omar,

As Jack already suggested, given a static list of parent IDs you must use parent field in combination with issuetype and summary fields to retrieve the desired subtask issues.

 

In addition to this suggestion, in case you want to retrieve subtask issues matching an specific summary but in a list of dynamic parents you must go for a third-party app.

i.e. using JQL Booster Pack (FREE) you query will look like:

Retrieve any subtasks containing "this-text" in the summary directly created under unresolved Stories of project EMEA

 

summary ~ "this-text" AND issue IN subtasksOf('project = EMEA AND type = Story AND resolution IS EMPTY')

 

That's pretty the same you already typed however you used parentsOf() function which seems to be incorrect.

 

Kind Regards

Suggest an answer

Log in or Sign up to answer