The CreatorCon Call for Content is officially open! Get started here.

Filter CI to some certain classes in INC form

Johnson13
Tera Expert

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

 

 

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

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

find_real_file.png

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

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

find_real_file.png

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur, 

 

Thanks for your help, this approach also work. I just decided to do the script include. 

Ian Mildon
Tera Guru

I found the easiest way of doing this was with an advanced Reference Qual entry. The value we have setup is:

sys_class_nameINSTANCEOFcmdb_ci_hardware^ORsys_class_name=cmdb_ci_business_app^ORsys_class_name=cmdb_ci_vpn^ORsys_class_nameINSTANCEOFcmdb_ci_comm^ORsys_class_nameINSTANCEOFcmdb_ci_ip_phone^ORsys_class_name=cmdb_ci_crac^ORsys_class_name=cmdb_ci_generator_power_eq^ORsys_class_name=cmdb_ci_ups^ORsys_class_name=u_cmdb_ci_fire_suppression^nameISNOTEMPTY^install_status!=7^EQ

Which looks like this in the condition builder view:

find_real_file.png

Hi Ian,

 

We don't want to touch the task base table. the idea is to create a Dictionary Overrides so that it will only affect the Incident, other tables will not be affect with the filter. and to build a condition will be too much . because take for instance HARDWARE, will want to capture all other classes that extended under the cmdb_ci_hardware, cmdb_ci_server, will would like to capture things like Windows server, Linux server etc.