Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagegroovy
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


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 - https://botronsoft.atlassian.net/wiki/spaces/CMJ/pages/517799941/Quick+Fix.