Jira SQL query that returns all filters that are shared

Sorin Sbarnea (Citrix)
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 21, 2012

I am looking for a Jira SQL query that returns all filters that are shared with other users (that are not private).

6 answers

1 accepted

7 votes
Answer accepted
Scott Harman
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 10, 2013
SELECT sp.entityid, sp.sharetype, sp.PARAM1, s.filtername, s.authorname, s.DESCRIPTION FROM searchrequest s LEFT JOIN sharepermissions sp ON sp.entityid = s.ID WHERE sp.entitytype = "SearchRequest" AND sp.sharetype != "global"

Sorry to bring up this old one again, but I was looking for the exact opposite of this ;)

Petr Musil May 14, 2014

Thanks Scott. This is exactly what I want. Norman you are right it is easy when you know where to find information what you yre looking for, but if you can only copy, paste and run it is more easier :-D. Thank you both guys.

Like abigtoe likes this
Norman Abramovitz
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.
May 14, 2014

Petr, I hope you will take some time to learn alittle SQL. It is a very important skill to have to understanding the various systems you might work with now and in the future. Copying code without a minimal understanding can be very dangerous to projects.

2 votes
Norman Abramovitz
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 21, 2012

There is a table called sharepermissions. It contains a row for each shared filter rule.

The entitytype field will have value 'SearchRequest'

The sharetype field will have values of global, project or group.

The entityid field contains the id of the searchrequest table.

The filename in the searchrequest table is the name of the filter.

There are no rows in the sharepermissions table if filters are private.

If you really need me to create the sql query, let me know. This is a simple query once you understand the table structure.

0 votes
Rishikesh Dugyala September 28, 2018

SQL query to get the filters which are shared

 

select * from searchrequest where id in (select entityid from sharepermissions where entitytype='SearchRequest');

0 votes
Rishikesh Dugyala September 28, 2018

Can anyone help me out to find SQL query for filters updated or modified on specific date?

0 votes
Antonio Bosio February 3, 2016

Try this query:

select count(*) from searchrequest where reqcontent LIKE '%project = xyz%'
0 votes
sasis July 31, 2014

Hi,

Any one have idea about sql Query to fetch the project name in shared filters

ie if filter name is fdpio which consists project =xyz

i would like to get the filters with particular value xyz

Suggest an answer

Log in or Sign up to answer