Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Filter condition - adding a 'is a' option through script

Chaz_
Tera Guru

Hi,

 

On CMDB Data manager, when setting up a new certification policy and defining the condition for the CI Class, it doesn't have the Class 'is a' option. This is useful, so that we can include bunch of classes under 'server' for example.

 

Is there a way we can get around this, through javascript? Or does anyone know how we can have this option added onto data manager policies?

 

Thanks.

Chaz.

4 REPLIES 4

Sheldon  Swift
ServiceNow Employee
ServiceNow Employee

Hi @Chaz_ - You might be able to modify the data filter condition builder in UI Builder (CMDB Workspace > Data Manager Policy Form), but—even if you manage it—I wouldn’t recommend it. Unless there are hundreds of extensions, it’s probably best to just add Class is Server AND Class is x AND Class is y...and so on.

 

That said, you could theoretically work around the issue by updating the Encoded Query on the CMDB Data Management Certification Policy record [sn_cmdb_ws_dm_certification_policy], after you've created the policy. It probably won't let you do it in the UI, but it should work via background script.

 

Class is a Server would be:

policyGr.setValue('encoded_query', 'sys_class_nameINSTANCEOFcmdb_ci_server');

 

Note: This is untested, and I have no idea if modifying the encoded query in this way will break anything in the workspace, or anywhere else.

spgarg04
Giga Guru

Hello Chaz,

 

I see it differently in my instance, can you share the screenshot or the path. 

 

I see the class is a option enabled in my data manager. 

 

 

if my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.



Best regards

Surya Prakash Garg

Connect me on Linked In

https://www.linkedin.com/in/spgarg/

Hi,

Here is a screenshot showing 'is a' option does not exist,

 

Chaz__0-1730194284131.png

 

 

you are right, i can't see it in the CMDB workspace, but I can see this option in the data certification under All menu. 

if my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.



Best regards

Surya Prakash Garg

Connect me on Linked In

https://www.linkedin.com/in/spgarg/