Filter Configuration Item Template based on Principle Classes
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2023 11:40 AM
Request was to only allow templates to see principle classes ( same as the CI field on the Change ticket was filtered).
This reduced CI numbers from 2m to 90k
Solution:
I combined 2 community posts into 1 Business Rule on the cmdb_ci table
(function executeRule(current, previous /*null when async*/ ) {
try {
if (gs.action.getGlideURI().getMap().get('sysparm_target')) {
var targetName = gs.action.getGlideURI().getMap().get('sysparm_target');
if (targetName.indexOf('change_request.cmdb_ci') > -1) {
current.addEncodedQuery('sys_class_nameINjavascript:new PrincipalClass().getPrincipalClasses()');
}
}
} catch (e) {}
})(current, previous);
Referenced
https://www.servicenow.com/community/now-platform-forum/filtering-on-principal-class/m-p/1072188
and
0 REPLIES 0