Multiple JQL queries in a single report

Rajesh Dhuri September 22, 2013

We have a requirement where we need to combine the results of multiple filters/jql's into a single report.

Is there a plugin available for the same? Could anyone please suggest how could we achieve this?

2 answers

0 votes
Pablo Beltran
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 1, 2015

The SQL for JIRA plugin is able to achieve it seamlessly as it fully supports JQL integrated with SQL. The SQL language supports the UNIION command for that. Ex:

 

 

select * from ISSUES where JQL = 'project = TO and issuetype = Bug'
union
select * from ISSUES where JQL = 'project = TT and issuetype = Bug'

alternatively you might want to combine both JQL queries within a single one only:

select * 
from ISSUES 
where JQL = '(project = TO and issuetype = Bug) 
              OR (project = TT and issuetype = Bug)'

both queries would provide the same result data. 

 

 

Keith Shaw December 11, 2018

Thanks @Pablo Beltran
This did not work in my most recent attempts. 
Do you have a guide for users of the add-on or updated instructions on how to merge / unite complex JQL results ?

Pablo Beltran
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.
December 11, 2018

This part is pure SQL, therefore it is unmodified as it's part of the H2 core engine.

Perhaps there is some other error in your SQL+JQL query. (?)

Keith Shaw December 11, 2018

Wow amazingly fast reply !
I actually found a very useful built-in function in JQL that allows this. 

For example:
filter = "Active Issues where currentUser in summary, description, comments"
OR filter = "Active Issues where Participant = Current User"
OR filter = "Active issues where Watcher = Current User"

https://community.atlassian.com/t5/Jira-questions/Selecting-quot-OR-quot-value-of-multiple-filters/qaq-p/443271

Like # people like this
Matthew Underwood June 19, 2019

Thanks Keith - this really helped me out with a query that had far too many OR's for JQL to handle.

I split the query into three working separate filters and then referenced them all using your example.

It worked a treat! 

Cheers,

Matt.

0 votes
Jobin Kuruvilla [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.
September 22, 2013

Depends on what kind od report you are looking for!.Checked the filter statistics gadget?

Rajesh Dhuri September 22, 2013

Unfortunately, this plugin won't help. Allow me to explain it further, suppose I have written one JQL for a jira project 'TEST One'.

eg. project = TO and issuetype = "Bug"

and another jql for another project 'Test Two'

eg. project = TT and issuetype = "Bug"

I want the results for both JQL's in a single report in Jira. Can I use a join?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 22, 2013

No, you need to merge the two queries together.

Project in (TT, TO) and issuetype = "Bug"

Theinvisibleman
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 22, 2013

I think both of those queries work, based on a quick test that I just did.

Florin Manaila
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.
September 22, 2013

Not sure what kind of performance impact this may have, but why not "OR" everything together in a jql?

(project = TO and issuetype = "Bug") OR (project = TT and issuetype = "Bug")

Jenin CM September 23, 2013

Nick's query will work incase the jql's are similar and Florin's query should work for any jql combination I guess...thanks Jobin, Nic and Florin

Suggest an answer

Log in or Sign up to answer