Forums

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

Create a nested JQL query

Eddie Hobart
Contributor
July 21, 2025

I have a kanban board that's been built to work on items from a specific epic. I'd like to make something of a nested query to show additional items however. Specifically, items that are linked to stories within that epic (relates to, blocked by, etc.)

These tickets aren't directly linked to the epic, but instead to the story that resides in the epic (the bugs and tasks that are linked). Is this possible without a plugin? I have a fairly large Jira instance and it won't be easy to get budget approval just to run a special query :)

3 answers

4 votes
Trudy Claspill
Community Champion
July 21, 2025

Hello @Eddie Hobart 

The options to query for linked issues natively are found her:

https://support.atlassian.com/jira-software-cloud/docs/jql-functions/#linkedWorkItem

Unfortunately the functions require you to provide a single explicit issue key for which you want to find the linked issues.

So with only native JQL functionality it is not possible to do what you want directly.

A work-around (but not a good work around) would be to add something to each of the linked issues, like a Labels value, that you could add to your JQL to retrieve the linked issues. You could use Automation Rule(s) to add/remove that extra value as links are added/removed to the issues within the target Epic.

0 votes
PM_이유경 July 21, 2025

hello, 

If you're on the Standard plan, the fastest way might be to categorize using labels or custom fields, and then sort by that field.

0 votes
Vitalii Rybka
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.
July 21, 2025

Hi @Eddie Hobart,

Unfortunately, JQL doesn't natively support nested queries or transitive relationships, so you can't directly query "issues linked to stories that belong to epic X" in a single JQL statement without additional apps.

Here are your options:

Option 1: Manual JQL approach

  1. First, get all stories in your epic:
    "Epic Link" = EPIC-123
  2. Copy the resulting story keys
  3. Create a second query for linked issues:
    issue in linkedIssues("STORY-1,STORY-2,STORY-3") OR issueFunction in linkedIssuesOf("project = PROJ AND 'Epic Link' = EPIC-123")

Option 2: Saved filters + Dashboard

  • Create a saved filter for the epic stories
  • Create another for issues linked to those specific stories
  • Combine them on a dashboard for a unified view

Option 3: Structure for Jira (if budget allows) This is specifically designed for hierarchical views and can show these relationships easily.

Option 4: Automation workaround Use automation to automatically add a label or custom field to issues when they're linked to stories in specific epics, then filter by that field.

Quick question: Are you looking for a one-time query or an ongoing board that auto-updates? The automation approach might be worth the setup effort if it's ongoing.

The manual approach is your best bet for now - it's just a two-step process. Let me know if you need help refining the JQL!

Hope this helps!

Trudy Claspill
Community Champion
July 21, 2025

@Vitalii Rybka 

In Option 1, step 3, the filter you have specified is not available without acquisition of a third party app. issueFunction in linkedIssuesOf(<subquery>) is not a native JQL feature.

Like Maria Rusnakova likes this
Tinker Fadoua
Community Champion
July 21, 2025

I agree with @Trudy Claspill , only if you have an App you will be to introduce certain functions in your JQL.

Best,

Fadoua

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