- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2019 04:31 PM
Please I need help to write a script include that will filter CIs to some classes in INC form. classes includes:
Application
Business Service
Business Application
Business capability
Hardware
Storage Device
Voice System Hardware.
the Idea is that we do not want to expose all the CIs in the cmdb to Caller/service desk. we want to limit them to those classes only.
Any help will highly be appreciated
Solved! Go to Solution.
- Labels:
-
Instance Configuration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2019 07:11 PM
Hi,
you can set the filter condition in the field by configuring the dictionary for cmdb field on incident form to show only those classes; create a dictionary override record for incident table and override reference qualifier as true; ref qualifier as below
sys_class_name=cmdb_ci_business_app^ORsys_class_name=cmdb_ci_service^ORsys_class_name=cmdb_ci_business_capability^ORsys_class_name=cmdb_ci_hardware^ORsys_class_name=cmdb_ci_storage_device^ORsys_class_name=cmdb_ci_volume_template^EQ
Ensure you give all class names correctly; In order to get this condition/filter go to cmdb table and apply the filter condition for your classes; copy the query and paste it in ref qualifier
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2019 08:38 AM
Here is an example Script Include filter which you would call from the Reference qual entry with:
javascript:getFilteredCIs()
function getFilteredCIs(){
var ciClassListProperty = 'cmdb_ci_aix_server,cmdb_ci_business_app,cmdb_ci_computer,cmdb_ci_config_file,cmdb_ci_esx_server,cmdb_ci_hardware,cmdb_ci_hpux_server,cmdb_ci_ip_switch,cmdb_ci_lb_netscaler,cmdb_ci_linux_server,cmdb_ci_peripheral,cmdb_ci_personal_printer,cmdb_ci_printer,cmdb_ci_print_queue,cmdb_ci_rack,cmdb_ci_scanner,cmdb_ci_server,cmdb_ci_service,cmdb_ci_solaris_server,cmdb_ci_unix_server,cmdb_ci_win_server,u_application_interface,u_application_module,u_monitor,cmdb_ci_comm,cmdb_ci_ip_phone';
var ciArr = ciClassListProperty.split(',');
var str = '';
for (i=0; i<ciArr.length;i++)
{
if (str == '')
str += 'sys_class_name='+ciArr[i];
else
str += '^ORsys_class_name='+ciArr[i];
}
return str;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2019 01:00 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2019 07:31 AM
Hi,
you can easily do this for incident table using dictionary override
Did you check my previous comment?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader