How to apply filter in configuration item -incident

chanikya
Tera Guru

Hi,

some one kindly suggest me how to apply filter on Configuration item field of incident- That filter condition but be reflect on only Incident

need to show below classes only

- Servers
- Computer
- Chromebooks
- Database Instance
- Router
- Switch
- VPN
- Load Balancer

1 ACCEPTED SOLUTION

Hi,

Yes, you'd want to add your query that you created and copied, to the same "return" result in this script include. The first main if statement would apply be for incident, the second main if statement you can leave alone as that's for requests and request items.

So you'd want to add it to what is already there so like:

if (type == 'Software') {
return 'ref_cmdb_ci_spkg.u_importance!=^sys_class_name=cmdb_ci_spkg';
} else {
return ''; <----------- add it here

For example. Otherwise for that first entry, Software, that has it's own reference qualifier it seems.

I don't know your instance requirements, etc. but you'd want to add the reference qualifier where you need it.

Please mark reply as Helpful/Correct, if applicable. Thanks!

 


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

8 REPLIES 8

Hi,

Yes, you'd want to add your query that you created and copied, to the same "return" result in this script include. The first main if statement would apply be for incident, the second main if statement you can leave alone as that's for requests and request items.

So you'd want to add it to what is already there so like:

if (type == 'Software') {
return 'ref_cmdb_ci_spkg.u_importance!=^sys_class_name=cmdb_ci_spkg';
} else {
return ''; <----------- add it here

For example. Otherwise for that first entry, Software, that has it's own reference qualifier it seems.

I don't know your instance requirements, etc. but you'd want to add the reference qualifier where you need it.

Please mark reply as Helpful/Correct, if applicable. Thanks!

 


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Thanks Allen , it is working fine.

Thanks for your support !

hi @Allen Andreas 
We have a requirement to filter CI selection on Change Request form to show CI's from the Principal Class filter only for which we are using the below Reference Qualifier override on Change Request which correctly filters CI's from the Principal classes
sys_class_nameINjavascript&colon;new PrincipalClass().getPrincipalClasses();
Now, the issue is for certain Class eg: Software Instance class, we need to show only the unique names with the latest version in the list.
For eg: Google Chrome has multiple entries in the Software instance table, so we need to show only one entry of 'Google Chrome' in the CI list, Similarly for all CI's we need to show only Installed CI's and filter out the Retired CI's from the list.
Can you please help suggest how can i update the reference qualifier to show latest version software only in this principal class filter.

peterdelf
Giga Expert

https://docs.servicenow.com/en-US/bundle/sandiego-servicenow-platform/page/product/configuration-management/task/update-principal-class-filter.html