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.

CMDB Group Metadata

Jeya priya
Tera Contributor

CMDB Group meta data (sn_cmdb_ws_group_metadata) How the CI count is calculated based on the group anyone can explain because except PC and device other count shows 0.

1 REPLY 1

dbook
Mega Sage

There is a scheduled script execution which runs daily 'CMDB Workspace - Populate aggregates Daily', this invokes the function 'cmdbWorkspaceUtil.populateNoOfMatchingCIsForEncQrys'

The cmdbWorkspaceUtil handles record updates in the sn_cmdb_ws_group_metadata table by:

  • Loops CMDB Workspace groups,

  • For each group, loops its encoded queries and uses GlideAggregate to count matching CIs,

  • Writes per-query counts to sn_cmdb_ws_group_query_metadata,

  • Sums them and writes one per-group row to sn_cmdb_ws_group_metadata,

  • Then cleans up any metadata records whose groups/queries have been deleted.