Forums

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

Identify filters wher Custom Field ID is used instead of Custom Field name

Gueroihi Anas December 4, 2023

Hello,

As part of a migration I am importing filters and I face an issue. Some filter queries contain Custom Field ID instead of Custom Field name. Is there a way to identify all the filters that contain Custom Field ID instead of Custom Field name ? (because I am importing 600 filters).

Thanks

3 answers

0 votes
Trudy Claspill
Community Champion
December 4, 2023

Hello @Gueroihi Anas 

If you have direct access to the database you could query the data directly in the searchrequest table.

If a custom field id is used in a filter rather than the field name, in the filter you will see

cf[#####]

So you could execute a database query like this (postgres)

select *
from searchrequest
where reqcontent like '%cf%'

 

If you don't have direct access to the database, you might consider this app (that one of my colleagues brought to my attention:

Home Directory, Database & Log File Browser for Jira 

It looks like it will let you run database queries from the Jira UI.

Note I have not used the app before so I can't offer any feedback about how well it works.

0 votes
Marc - Devoteam
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 4, 2023

Hi @Gueroihi Anas 

You could use the marketplace app Optimizer for Jira.

In the app you can search the JQL from any filter, this will enable you to see if an id is used within a filter.

The app is available for Cloud, Server and DC

0 votes
Mohamed Benziane
Community Champion
December 4, 2023

Hi,

If you have scriptrunner you could use this to find all filter and then look at each filter
https://docs.adaptavist.com/sr4js/latest/hapi/work-with-filters#find-all-filters

Gueroihi Anas December 4, 2023

Hello Mohamed,

Unfortunately this doesn't allow me to list filter queries that contain Custom field ID instead of Custom Field name

Suggest an answer

Log in or Sign up to answer