Exclude a CMDB class from Configuration Item field on IPC forms

SoumyaGanguly
Tera Contributor

Hi forum

I had a custom CI class defined as Business Application Custom (going to be sun downed) which I migrated to OOB Business Application table (cmdb_ci_business_app), both the classes are active due to some operational challenges. In IPC forms, the configuration item field is referring to both the classes now. I want to remove the reference to the custom table in the IPC form so that when I search for any business application, it does not show two entries. I tried with a simple reference qualifier like following which did not help. Basically, I want to see all the CIs other than the Business Application Custom class.

SoumyaGanguly_0-1673640290086.png

 

Though I made the above mentioned change, this is something I am getting, which is not intended.

SoumyaGanguly_0-1673640479187.png

Any suggestions?

 

Thanks in advance

SG

1 ACCEPTED SOLUTION

kmohammed
Kilo Guru

 

You can try using a script in the reference qualifier to filter out the custom class from the Business Application field. Here's an example of the script you can use:

 

Copy code
(current.getTableName() != "cmdb_ci_business_app_custom")
 

You can add this script to the reference qualifier of the configuration item field. This script will filter out all records from the cmdb_ci_business_app_custom table, so only records from the cmdb_ci_business_app table will be displayed in the field.

Another way you can achieve this, is by creating a UI Policy with a condition which checks the class of the selected CI, if it is the custom class, then it will make the field read-only and clear the value.

Please make sure to test these changes in a development or test instance before applying it to production.

View solution in original post

4 REPLIES 4

emir
ServiceNow Employee
ServiceNow Employee

I would change the reference to Business Application (you will gain performance here by not querying the entire CMDB) and then filter for class is Business Application.

What you have there should work. Are you sure there is not another ref qual anywhere?

Hey Emir

This is the OOB Configuration Item field in Incident =/change/problem form. In the qualifier, I am trying to exclude Business Application Custom class

kmohammed
Kilo Guru

 

You can try using a script in the reference qualifier to filter out the custom class from the Business Application field. Here's an example of the script you can use:

 

Copy code
(current.getTableName() != "cmdb_ci_business_app_custom")
 

You can add this script to the reference qualifier of the configuration item field. This script will filter out all records from the cmdb_ci_business_app_custom table, so only records from the cmdb_ci_business_app table will be displayed in the field.

Another way you can achieve this, is by creating a UI Policy with a condition which checks the class of the selected CI, if it is the custom class, then it will make the field read-only and clear the value.

Please make sure to test these changes in a development or test instance before applying it to production.

emir
ServiceNow Employee
ServiceNow Employee

You said IPC forms, so I assumed a Svc Request.

 

If it is the change form, chances there is something else (like a categorization) driving the selection of the CIs. So look for places that could be invoking the reference qualifier. With what you have given us, we cannot guide you properly.