Default CMDB Filter for All Tables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2017 11:21 AM
Is there a way to apply a default filter for any CMDB table that a user navigates to? We are using Status (install_status) to track CI retirement, but we are getting a lot of new users who are coming to consume the data, and I keep getting questions/comments from end users who are navigating the CMDB saying, "Why am I seeing all this old stuff?" or "Man your CMDB sucks!"
I'm sure I can go through and add a default filter to each of the navigator modules, where install_status!=retired, but I would like to have this filter apply no matter what table a users goes to, even if they manually type in the back-end list name in the navigator. It would be best if the filter still shows up in the filter conditions as well, that way it is easy for everyone to still view the retired CIs, but not have them show up and muddy the waters right off the bat.
I understand that I may not be able to cover all the cases, such as users' bookmarks and the likes, but I'd rather have something in place for future users that I haven't told about "install_status!=retired"..
Thanks!
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2017 01:06 PM
Try adding a UI Script that looks to see if the url contains both cmdb_ci and list.do and then update or add "sysparm_query" to include your filter. Here is
var url = document.URL;
if(url.indexOf('cmdb_ci') != -1 && url.indexOf('list.do') != -1){
var purl = url.parseQuery();
var currentQuery = decodeURI(purl['sysparm_query']);
// add in appropriate logic to determine how to add in your bit of query install_status!%3D7
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2017 01:48 PM
Keep in mind - you need to probably add a lot more logic. For example, if they are adding filters to the list they are already viewing, it will run this as it is current written and may cause issues if they need to see retired records.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2017 01:53 PM
Definitely good advice, I'm sure we could check the sysparm_query in the URL before applying the default that I'm after, and brilliant idea on the parse.. I will look into implementing this as a viable solution.
Still wish there was an OOB way to apply this at the top level of the CMDB.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2017 02:13 PM
Using a similar approach, you could use a before query business rule on the cmdb_ci table. Here is an example for incidents: