Hi. I have been playing around with and searching for a JQL query that will return a parent issue and all children.
I've reviewed a number of similar posts on the forum yet nothing is providing the results I am seeking.
Is there some combination like KEY = "issue key" AND/OR portfolioChildIssuesOf (Key)?
Or should the second field be childrenOfIssuesInQueryRecursive?
I've yet to find something that works
childrenOfIssuesInQueryRecursive depends on scriptrunner I think @Derek Sekuler - if you've got that then yes
This should work fine for you though:
key = <YOUR TARGET ITEM> OR issue in portfolioChildIssuesOf (<YOUR TARGET ITEM>)
I always forget the exact syntax and end up googling - there's a handy article here: https://www.praecipio.com/resources/articles/jql-functions
Depressingly GPT answered this precisely in 3 seconds after I'd bothered to manually type it up 😂 - here's the AI answer in case you'd like some fuller info:
To create a JQL query that returns a parent issue and all its child issues in Jira, the approach depends on the setup of your instance and the add-ons available. Here's how to proceed:
Out of the box, Jira's JQL doesn't natively support hierarchical queries like returning both a parent and its children (sub-tasks or portfolio-style children). However, you can manually combine criteria:
issueKey = "PARENT-123" OR parent = "PARENT-123"
This will:
PARENT-123
) explicitly.parent
field linked to that issue.If you're using Jira Advanced Roadmaps (formerly Portfolio), you can leverage the portfolioChildIssuesOf
function for higher-level hierarchy queries:
key = "PARENT-123" OR portfolioChildIssuesOf("PARENT-123")
This will:
For more complex queries (e.g., fetching children recursively for deeper hierarchies), Jira alone isn't enough. You need an app like ScriptRunner, JQL Search Extensions, or Structure.
key = "PARENT-123" OR issueFunction in childrenOfIssuesInQueryRecursive('key = "PARENT-123"')
If your hierarchy includes custom link types (e.g., "relates to," "is blocked by"), use issueFunction in linkedIssuesOf
with ScriptRunner:
issueFunction in linkedIssuesOf("key = 'PARENT-123'", "blocks") OR key = "PARENT-123"
key
, parent
, or portfolioChildIssuesOf
.parent
field convention.Would you like help refining your query further or exploring an add-on setup for deeper hierarchy support?
Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.