How to find the filters that uses a custom field

prakash ganeshan June 20, 2013

I have to find all the filters that uses a custom field. Please help me is there any wat to do this either on database or from JIRA UI

2 answers

3 votes
Udo Brand
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.
June 20, 2013

you can use this query.

select * from searchrequest s where s.reqcontent like '%yourfieldname%' or s.reqcontent like '%cf[yourcustomfieldid]%';

but there might be in addition filters that are using those filters

prakash ganeshan June 20, 2013

Hi Udo .. Thanks Now I am running into need of different help like ... Request your help on this too ..

We are planned to do the following change to one of the field of type 'drop down'.

Example:

Field Name : Projects (Not mandatory field)
Type : Drop down list

  • Renaming the field "Projects" drop-down to "Business".
  • Retiring some values in this field.
  • Renaming some values in the field.
  • Adding some new values to the list.
  • Making this field a required one.

Now I dont have any problem doing these changes. I have to change all the filters that uses this field and it's value. Please help me in doing the below activity.

1. I need to find and modify all the filters to use the field name as "Business" in place of "Projects" after rename.
2. I need to find and change all the filters that uses the value in the field "Projects" that are going to renamed.

Udo Brand
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.
June 20, 2013

first find the id of the field Projects and replace 'ID' with this id in the query below.

select * from searchrequest s where s.reqcontent like '%Projects%' or s.reqcontent like '%cf[ID]%';

for the second part, all filters which are using values which will be renamed are already within the resultset of the first part, since they will have 'Projects' in the filter

prakash ganeshan June 23, 2013

Hi Udo,

THanks for your help, just want to confirm from your end that "Does this custom field "Projects" in filter has reference to searchrequest table alone or it is referred in any other table ?"

Udo Brand
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.
June 23, 2013

Hi Prakash,

it has references to other tables as well but only with its ID. So renaming the field will have no other effect beside the one on the filters using this field.

Petra Goldstein June 22, 2017

The response above is good for advanced filters which are stored as text, but what about "Basic" filters?

Thanks,

Mike

Udo Brand
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.
June 22, 2017

Hi Mike,

Basic filters are stored in the same way as advanced filters. So it works for them as well.

Cheers,

Udo 

 

Petra Goldstein July 11, 2017

Interesting, Thanks, Udo! :-) 

0 votes
Cap10Bill November 14, 2018

Is there anyway to run this against the CloudAPI? I'm looking for all filters that use a couple of my custom fields that I'm looking are reworking. Need to get a list of filters to look at.

Suggest an answer

Log in or Sign up to answer