Search code examples
jirajql

Query that returns issues without parent in JIRA


I want to get all issues that don't have or have parent. I tried the following query for issues without parent: issuetype in ("Epic","User Story") AND "Epic Link" is EMPTY but I’m not sure this is returning what I expect.

I’m also looking for any place I can get a tutorial or information about the queries more generally. Thanks!


Solution

  • As for “all items without the parent”, there would be a couple of different behaviors here. Firstly, Jira treats Epics as a type of parent object, so you are on the right track for checking there. As well, if a ticket is if type subclass, it will have a parent. So if you are just looking for all of your “User Stories”, then you are best serviced by checking for that type.

    issuetype in ("Epic","User Story") AND "Epic Link" is Empty and issuetype not in (SubTaskIssueTypes())

    As for tutorials, the native Atlassian documentation is helpful for high level JQL advice and tips and tricks, however your workflow will often be something specific to your business, so answering questions like “How do I see what my Marketing team has due this week” will depend on how you have them interacting with the system (what issue types they work with, how they use Epics, which field is the most relevant due date, etc). Which is to say, there are probably best practices, but would take some careful thought as to how to best have it service your business’s needs in the future.

    For starters, check out this blog-post from Atlassian, it’s not a bad place to begin. https://www.atlassian.com/blog/jira-software/jql-the-most-flexible-way-to-search-jira-14