JQL Help: Return All Issues AND sub Issues WHERE Parent Issue matches set of JQL

Nikki Leonard December 1, 2022

I am trying to create a filter for use in Roadmaps where I want to show only a subset of project issues. 


  • I created a custom checkbox field, milestone type, and I want the filter to return all of the issues with 'milestone type = contract' AND the child issues of issues WHERE 'milestone = contract'
  • Here is my current query (generated from basic search) that returns only issues where 'milestone=contract' and not those issues subtasks: project = XXX AND "Milestone Type[Checkboxes]" = Contract order by created DESC

    How can I return the 'child of' issues? I have seen some similar posts but haven't found an answer that works. I am hesitant to get something like script runner app but will if that is the ONLY solution (surely Jira has a way as this is a simple request). 


2 answers

2 accepted

0 votes
Answer accepted
mauricio.groth
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.
December 2, 2022

Hi @Nikki Leonard 

As you're on Jira Cloud, the correct answer is to get an app that provides JQL extensions you're looking for.

With standard JQL, you can only get a list of issues and export them to Excel for further processing. This works if you want to do a one-off analysis. If your use case is more dynamic than that, look beyond standard Jira.

Standard JQL doesn't easily allow it, but you can quickly find the results using our professional indexing service JQL Search Extensions

  • You can use this query to find subtasks whose parents have Milestone Type[Checkboxes]' = Contract
issue in subtasksOfParentsInQuery("'Milestone Type[Checkboxes]' = Contract")
  • If you want to return both parents and subtasks please use the query below:
issue in subtasksOfParentsInQuery("'Milestone Type[Checkboxes]' = Contract") or project = XXX AND "Milestone Type[Checkboxes]" = Contract 

Check out the documentation for more examples.

If you have any other questions, please contact our support. We’ll be happy to help you!
Best regards,
Maurício

0 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 1, 2022

Hello @Nikki Leonard 

Jira does not natively provide a way for you to get issues and their children in one query when the list of parents is dynamic. This page provides info on the native search functions available specific to Advanced Roadmaps relationships.

https://support.atlassian.com/jira-software-cloud/docs/search-for-advanced-roadmaps-custom-fields-in-jql/

You will have to use a third party app to get what you want. ScriptRunner is one such app, but there are also others, such as Jira Search Extensions.

Suggest an answer

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

Atlassian Community Events