Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Deleted Filter in JIRA, how can I restore the filters?

Seem to have deleted filter by mistake and am now unable to see the related boards.

Please advise as to what to do?

I have the JIRA Admin access.

 

Thanks.

1 answer

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 07, 2018

Create a new filter with the same name and definition, then edit each board to replace the deleted one.

Same problem, this does not work.

Jira Server does not show the board so it is not possible to edit it.

Is there a workaround to actually edit the board and replace the filter?

you have to go to the database to find the board or using scriptrunner.

 

This finds the boards with no filterID --- if you update fix = True it will delete them.  This code was taken off a search I did elsewhere.

def fix = false //if set to true this will delete the boards that have no filter associated

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

 

Then if you know the board (rapidviewID) and create a new filter then this script will update the board and allow you to see it.

 
import com.atlassian.greenhopper.manager.rapidview.RapidViewManager
import com.atlassian.greenhopper.model.rapid.RapidView
import com.onresolve.scriptrunner.runner.customisers.PluginModuleCompilationCustomiser
import com.atlassian.jira.component.ComponentAccessor

long BOARD_ID = 296 //change to the rapidview id
long FILTER_Id = 79382 //new filter for that board

def rapidViewManager = PluginModuleCompilationCustomiser.getGreenHopperBean(RapidViewManager)
def rapidView = rapidViewManager.get(BOARD_ID).get()

rapidViewManager.update(new RapidView.RapidViewBuilder(rapidView).savedFilterId(FILTER_Id).build())
Like Brian Swackhamer likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events