JQL query to return epics without story or task

Dhanalakshmi s
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 21, 2024

Can someone please do help on this issue.

5 answers

1 vote
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 21, 2024

Hi @Dhanalakshmi s  - Welcome to the Atlassian Community!

You will not be able to do this without an add-on app like ScriptRunner. 

0 votes
Brandon Chin April 22, 2024

Hi @Dhanalakshmi s 

I am part of the Customer Success Team for ScriptRunner. This can be accomplished with ScriptRunner add on. You can start a trial to try it for yourself and use the suggestion by @Sudarsana G. I am happy to go through the features with you if you are interested. 

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.
April 22, 2024

Hi @Dhanalakshmi s 

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

Unfortunately, natively, 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 get all epics with 0 children:

issuesInEpicCount = 0

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

We’ll be happy to help you!

0 votes
Olliver Ordell April 22, 2024

Hi @Dhanalakshmi s 

I got the same request from a colleague and solved it without add-ons. It can be done with an automation that adds a specific label to Epics with no children.

The trigger can we scheduled to run once a day, or just when someone creates an issue.

The automation does the following:

  1. Remove the label thisEpicHas0Children from all tickets that has this (reset)
  2. Find all Epics in a project.
  3. Use a "Related issues condition" to find all Epics with 0 children.

  4. Add the label "thisEpicHas0Children" to those

You can now make a JQL query that searches for all tickets with this label.

0 votes
Sudarsana G
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.
April 21, 2024

issuetype = Epic AND issueFunction not in hasLinks("is epic of") AND issueFunction not in linkedIssuesOf("issuetype = Story OR issuetype = Task")

 

  • issuetype = Epic: Filters issues to only include epics.
  • issueFunction not in hasLinks("is epic of"): Excludes epics that are linked to other epics (since an epic cannot be a child of another epic).
  • issueFunction not in linkedIssuesOf("issuetype = Story OR issuetype = Task"): Excludes epics that are linked to stories or tasks.

This query will return epics that do not have any linked stories or tasks.

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 21, 2024

This will need the ScriptRunner add-on. 

Like # people like this
Dhanalakshmi s
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 24, 2024

Hi Sudarsana G

 

issuetype = Epic AND issueFunction not in hasLinks("is epic of") AND issueFunction not in linkedIssuesOf("issuetype = Story OR issuetype = Task") it's working fine when we disable the hasLinks() in Powerscript for Jira plugin and JQL Tricky plugin also we have disable it so can you please help me out with some other alternative ways.

Thank you in advance.

Suggest an answer

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

Atlassian Community Events