Missing board filter with id 'xxxxx'

Symptoms:

Integrity check reports missing saved filter of a board.

Cause:

Most likely the board filter has been deleted, if so the board is not accessible via the UI.

This is related to https://confluence.atlassian.com/jirakb/boards-are-not-visible-after-the-filter-is-deleted-779158656.html 

Resolution 1:

  1. Create a new filter. For its query you can use something like 'project = XXXX', where XXXX is any project of your choosing.
  2. In the JIRA's database in the AO_60DB71_RAPIDVIEW table update the SAVED_FILTER_ID of the problematic boards to use the newly created filter's ID. To find the problematic boards you can use their ID's from the URL in the links represented by the boards' names in the integrity check result.
  3. Refresh JIRA’s internal caches for this change to be picked up – you can do that by going to CMJ’s Advanced page and clicking the Clear caches button.

Resolution 2:

It is also possible to remove the affected boards with the following Groovy script. Running the script will list all boards with missing filters. Changing the fix variable to true and running the script will delete the affected boards.

def fix = false

import com.atlassian.greenhopper.model.rapid.RapidView
import com.atlassian.greenhopper.manager.rapidview.RapidViewManager
import com.onresolve.scriptrunner.runner.customisers.JiraAgileBean
import com.atlassian.jira.issue.search.SearchRequestManager
import com.atlassian.jira.component.ComponentAccessor

public class NoCheck implements RapidViewManager.RapidViewPermissionCheck
{
	public boolean check(RapidView view)
	{
		return true;
	}
}

@JiraAgileBean RapidViewManager rapidViewManager
SearchRequestManager srm = ComponentAccessor.getComponent(SearchRequestManager)

def removed = []
rapidViewManager.getAll(new NoCheck()).value.each {b->
	if(srm.getSearchRequestById(b.savedFilterId)==null) {
		if(fix) {
			def res = rapidViewManager.delete(b)
		}
		removed.add("${b.id},${b.name},${b.owner}")
	}
}
def result  = removed.join("\n")
return result


For the latest version of the script runner app (i.e 6.14.0), use the below code:


def fix = false
 
import com.atlassian.greenhopper.model.rapid.RapidView
import com.atlassian.greenhopper.manager.rapidview.RapidViewManager
import com.onresolve.scriptrunner.runner.customisers.JiraAgileBean
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
import com.atlassian.jira.issue.search.SearchRequestManager
import com.atlassian.jira.component.ComponentAccessor
 
public class NoCheck implements RapidViewManager.RapidViewPermissionCheck
{
    public boolean check(RapidView view)
    {
        return true;
    }
}
@WithPlugin("com.pyxis.greenhopper.jira")
@JiraAgileBean
RapidViewManager rapidViewManager
SearchRequestManager srm = ComponentAccessor.getComponent(SearchRequestManager)
 
def removed = []
rapidViewManager.getAll(new NoCheck()).value.each {b->
    if(srm.getSearchRequestById(b.savedFilterId)==null) {
        if(fix) {
            def res = rapidViewManager.delete(b)
        }
        removed.add("${b.id},${b.name},${b.owner}")
    }
}
def result  = removed.join("\n")
return result


Resolution 3:

To delete the affected board the integrity check violation offers a quick fix. More about quick fixes in integrity check could be found here.