How to find JIRA tickets with no parent issue using JQL

I need help writing a JQL query to find all tickets that either have a parent or don’t have one. Right now I’m trying this query to get items without parents:

type in ("Story","Epic") AND "Epic Link" is NULL

But I’m not confident this gives me the right results. Does anyone know if this approach works correctly? Also wondering if there’s a good resource or guide somewhere that explains JQL syntax better. I keep running into issues with these searches and could use some documentation recommendations.

Your query’s mixing Story and Epic types while checking Epic Link - that’s the problem. Stories can have epic links, but Epics don’t have parent epics through that field. You need separate queries for what you’re actually looking for. For stories without epics: type = Story AND "Epic Link" is EMPTY. For epics without hierarchical parents: type = Epic AND parent is EMPTY. I’ve been working with JQL for years - JIRA’s hierarchy uses different mechanisms depending on your setup: epic links, parent-child relationships, sometimes custom hierarchy fields. Your syntax works fine for stories, but throwing Epic type into the same query creates confusion since epics don’t use epic links like stories do.

Your query might work sometimes, but you’re checking the wrong field. Epic Link is only for stories connected to epics - it won’t catch general parent-child relationships. For tickets without any parent, use parent is EMPTY or parent is NULL. I’ve found EMPTY works better across different JIRA setups. Want to get more specific? Try issueFunction in subtasksOf("") to find orphaned subtasks. Here’s what tripped me up when I started with JQL: different hierarchies use different fields. Parent/child for subtasks, epic link for story-epic stuff, and custom fields for everything else. Check your JIRA admin section to see which fields you actually have available.

try parent is EMPTY instead - it’s more reliable than checking epic link fields. if u need specific parent-child relationships, use issueFunction in hasLinks("is subtask of"). the atlassian docs are okay, but you’ll learn jql’s quirks faster through trial and error.

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.