Filter search not working for saved filters in Jira Data Center
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Some saved Filters are not showing up when searching for them in Gadgets configurations screens, Boards configuration or the Filter search itself.
Environment
Any version of Jira Data Center.
Diagnosis
1. Filter permissions
The Filter is accessible to the logged user. If the Filter has restrictions to it, it may not show up in searches. You can confirm if you have access to the filter by fetching its Id from the DB:
select id, filtername, authorname, username, description, reqcontent
from searchrequest
where lower(filtername) like lower('%REPLACE_FILTER_NAME_HERE%');
And pasting the Filter's Id from the first column above to the URL, like:
https://jira-base-url/issues/?filter=99999
If the Filter's not accessible, it's expected it won't show up in searches by the same user.
2. Special characters in the Filter name
Other Filters are working and the Filters that aren't working have special characters in them, like the Underscore "_".
3. Filter is not found or works intermittently
In some cases, the permission is correct, but the filter is still not found.
Cause
1. Filter permissions
When a user doesn't have permission to a filter, the search will treat it as if the filter didn't exist for that user.
2. Special characters in the Filter name
Filters with Underscore in their names won't work well in Filter searches, as further explained in the Issue below:
JRASERVER-67927 - Filter search for filters with underscore character causes to return no results
Since version 8.0.0, Jira follows a Unicode standard annex UAX#29 with regards to word boundaries. As per the standard, the underscore character (_) is not considered as a word boundary, which results in the behaviour described by this issue.
Because splitting words with underscores would mean creating our own standard, we don't plan to work on this for the foreseeable future. Instead, we encourage you to use characters other than the underscore, e.g. a dash (-) or space, as a workaround.
3. Filter is not found or works intermittently
In most cases in which the permission is validated but the filter is still not found, the filter is missing from the index - either due to a re-index error or due to index replication error.
Solution
1. Filter permissions
Grant the user (or group) permission to the filter.
2. Special characters in the Filter name
The solution is to rename all Filters with Underscores in their names to use some other work separator, like space or hyphen.
To list all Filters with Underscore in their names we need this DB query:
select id, filtername, authorname, username, description, reqcontent
from searchrequest
where filtername like '%\_%';
It's best to rename them through Jira's own GUI, browsing each Filter by it's Id:
https://jira-base-url/issues/?filter=99999
An improvement to prevent Underscores being used in Filters names' tracked on:
JRASERVER-74648 - Validate the name of Filters to avoid the usage of underscore character
3. Filter is not found or works intermittently
Run a full re-index.
If the problem persists, check if the re-index was successful and if there are errors in the logs when the re-index was running.
One specific bug that impacts filters is JRASERVER-75184 - When SearchRequest re-index takes a long time, the database connection is abandoned
This is fixed in Jira 10.2.0 and later