Forums

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

list of sub-task in the JQL query

Mayuresh Athalekar
Contributor
August 28, 2023

I have a custom field called CATEGORY. This is a multiple-choice field dropdown where I assign a field to either EPIC, User story, or Defect which are child items. I do not have this custom field category at the sub-task level as it is supposed to leverage this from the parent field as a linked item. 

Now when I want to get a list of all work items with CATEGORY = ABC, I do not get the child items of the user story.

Is there a way I can get a list of sub-tasks included where the query finds the child item of the parent whose CATEGORY = ABC?

3 answers

2 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.
August 28, 2023

Hi @Mayuresh Athalekar 

That is not possible with the out-of-the-box JQL features.

Your work-arounds for this scenario depend upon your frequency of use and willingness to purchase addons:

  • Need this one time: export your issues to a spreadsheet and join on the parent field in that tool
  • Need this often: investigate the Atlassian Marketplace for addons to add this feature to JQL

 

Kind regards,
Bill

0 votes
Hannes Obweger - JXL for Jira
Atlassian Partner
August 30, 2023

Hi @Mayuresh Athalekar,

Unfortunately, this is trickier than one might think; as a "hierarchical query", it would really require some kind of join or subquery, which isn't available in plain Jira/JQL.

A few directions forward:

  • If it's a one-off thing, you could first query the relevant parent issues, and then use the keys of these issues in a second query, in an "parent in (KEY-1, KEY-2, ...)" clause.

If you want to run your search dynamically, without manually stitching two queries together, you'll need extra tooling:

  • You might be able to use Jira Automation to "propagate" parent information down to the subtasks, and then use the respective field(s) on the subtasks to include them into your filter. Obviously, this will add a fair bit of complexity to your system.
  • There's different apps from the Atlassian Marketplace that can help with that. First, there's a number of apps that extend JQL by additional functions, including hierarchy-related functions. JQL Search Extensions has been mentioned before; I've used it a few times and it works well.
  • Alternatively, you could try one of the more hierarchy-focused apps from the Marketplace. These apps typically have their own ways of figuring out parent/child relationships between issues, and provide more powerful ways of searching through issue hierarchies. I myself work on such an app, in which your use case should be easy to solve - I'll provide more details below.

Hope this helps,

Best,

Hannes

Hannes Obweger - JXL for Jira
Atlassian Partner
August 30, 2023

Just to expand on the last point, this is how this would look in the app that my team and I are working on, JXL for Jira. Put simply, you'd create a sheet with all issues that are potentially relevant to you, enable the default hierarchy (that's one click), and then use JXL filtering capabilities to narrow down to the issues that you care about:

epics-for-label.gif

(I'm using labels here, but it would work the same way with any other field.)

Once you have your list of issues, you can work on these directly in JXL (much like you'd do in e.g. Excel or Google Sheets), trigger various operations in Jira, or export them for further processing.

Any questions just let me know!

0 votes
Charlotte Santos -Appfire-
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.
August 29, 2023

Hi @Mayuresh Athalekar 

I’m Charlotte, a support engineer at Appfire and I’m here to help you.

Unfortunately, using vanilla JQL, you’ll not be able to do it dynamically.

In the app where my team works, JQL Search Extensions for Jira, you can use this query to find all sub-tasks whose parents have category = ABC:

issue in subtasksOfParentsInQuery("'CATEGORY[Select List (multiple choices)]' = ABC")

Please contact our support if you have any other questions about this query.

We’ll be happy to help you!

Best regards,

Charlotte

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events