Forums

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

Does the JQL support the WHERE clause

Guangyu Zhang October 20, 2022

I am wondering if the JQL supports a WHERE-like clause as in the SQL.

E.g. I want to search for all the bugs whose EPIC link is in the result of another search. Could I write something like:

issuetype = Bug AND "EPIC Link" in (<<another search query>>)

3 answers

2 votes
Nic Brough -Adaptavist-
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.
October 20, 2022

No, it does not, because it doesn't need to.  JQL is not SQL.

The "where" is done implicitly by the search.  With JQL, you are writing where clauses automatically.

For example, the JQL

Project = XYZ

would be written in SQL as

select * from jiraissue where project = XYZ 

(actually, not that simple, you'd need a join to look up the project from its key, but you see where I'm going)

JQL does nothing but "select * from issues where <something>"  (You will see a lot of queries that have an order-by clause as well, but that's convenience for other parts of Jira.  The search doesn't look at it itself, just some of the places that show lists of search results read it when they;re rendering the report, like boards and the issue navigator)

0 votes
Trudy Claspill
Community Champion
October 20, 2022

Addressing your specific scenario of nesting filters, Jira JQL does not support that natively. You would need a third party app that extends JQL search features to support nesting filters.

This page gives you an overview and links to additional pages that explain the capabilities (functions, keywords, etc) you can use in Advanced Searching.

https://support.atlassian.com/jira-software-cloud/docs/what-is-advanced-searching-in-jira-cloud/

Here is a link to the Atlassian Marketplace (for third party apps) with search parameters to find app that impact the JQL functionality.

https://marketplace.atlassian.com/search?hosting=cloud&product=jira&query=jql

 

For example, these two in particular have functions that would give you what you want.

https://marketplace.atlassian.com/apps/1221331/enhanced-search-jql-subqueries?hosting=cloud&tab=overview

https://docs.adaptavist.com/es/latest/features/functions/epic-functions

 

 

https://marketplace.atlassian.com/apps/1214791/jql-search-extensions-for-jira-the-jql-extensions?hosting=cloud&tab=overview

https://jqlsearchextensions.atlassian.net/wiki/spaces/SEARCH/pages/3185901573/Epics+JQL+functions#ChildrenOfEpicsInQuery

0 votes
Cloudites Owner
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.
October 20, 2022

Yes, in some circumstances but not fully sql compliant. The jql editor for advanced search does a pretty good job of showing what will work and explains which cmds don't work.

There is a workaround using a single automation rule to create nested loops for down selects when jql doesn't provide a nested downspout option.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events