Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Create CMDB data Manager policy based on Principal Class

Yves-Robert Rei
Tera Contributor

Hi, we are trying to create a CMDB Data Manager Policy that would be based on CIs that are contained in a Principal Class. There are no filters avaialble to identify the notion of Principal Class in the Data Manager. As anyone encountered this issue and have a workarounf that is not to manually add each of the classes where Principal Class = TRUE in the policy?

 

I have the same problem in the CMDB query builder where I cannot build a CMDB query on a CI where the parent is in a principal class 

 

Thanks 

4 REPLIES 4

Niklas Peterson
Mega Sage

Hi,

It's because the information about a CI Class being Principal class is stored in the CMDB Class Information [cmdb_class_info] table. That's not accessable from a CI using references but requires more advanced logic.

 

Regards,
Niklas

We are considering a custom "display-only" field, added to each CI, to denote whether that CI is a member of a Principal Class. This seems like such a basic & important piece of information.  Is there a logical reason why ServiceNow makes it so hard to get to?   

Not applicable

Wouldn't it be nice if you could use the filter editor to add: Class is (dynamic) Principal Class?
Sorry to disappoint.

But if you think it's a good idea, vote for it!

Dynamic Filter Option for CMDB Class is (dynamic) Principal Class

phscontender_1-1741393338036.png

 

Dan Levin
Tera Contributor

The following steps ought to get you exactly what you're seeking!

 

1) Confirm that you've got the SN Utils browser extension installed.

2) Add the condition_builder=v2 attribute to the 'Encoded query' Dictionary Entry on the 'CMDB Data Management Policy' (cmdb_data_management_policy) table.


3) Double-click on the label of the 'Encoded query' field on an existing CMDB Data Management Policy, the SN Utils field editor should open.

4) Drop the Principal Class filter in and click 'Save'. The filter is as follows: 
sys_class_nameINjavascript:new PrincipalClass().getPrincipalClasses()