CMDB Dashboard for Leadership

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2025 10:07 AM
Hi,
I'm working on building a CMDB dashboard with an Organisational Group filter. The goal is to display CIs that are either:
-
Directly assigned to the selected group via the Managed by Group field, or
-
Assigned to any of its child groups, even several levels down the hierarchy.
Our organisation uses a hierarchical group structure, up to 4–5 levels deep, with parent-child relationships maintained in the 'Parent' field on the Group table. CIs are generally assigned to lower-level groups.
The challenge is if I am a leader selecting my group in the dashboard filter, I want to see all CIs associated with my group and all its child groups recursively.
Has anyone implemented something similar?
-
Is this achievable using interactive filters?
-
Would I need to build a custom breakdown or scripted indicator source to handle the group hierarchy?
Any suggestions on best practices or implementation approaches would be greatly appreciated.
Regards,
Ayman
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2025 07:38 AM
Hi @ayman_h ,
As per my understanding, You want to achieve this goal -
On the dashboard, when user selects a group → show all CIs:
* Managed directly by that group (Managed by Group field)
* OR managed by any of its child groups (down the full hierarchy)
Challenge:
ServiceNow’s out-of-the-box interactive filters only do a simple match:
ci.managed_by_group = selected group
They don’t natively support find this group AND all its descendants from the hierarchy.
Solution approach:
Option 1: Scripted Indicator Source (recommended & flexible)
* Use a scripted indicator source to dynamically resolve:
* Selected group + all child groups recursively
* Then use that in your PA widgets / reports.
How to do it:
1. Build a Scripted Indicator Source (or script include / dynamic filter option):
* Get the selected group sys_id from the dashboard filter
* Use GlideRecord + recursive query or getChildGroups() to get all descendant groups
2. Filter CIs:
ci.addQuery('managed_by_group', 'IN', <list of group sys_ids>);
1. Display the data in:
* PA widgets
* Report
* List / pivot etc.
Option 2: Dynamic Filter Option (DYN filter)
You can create a Dynamic Filter Option:
* Script that returns all child group sys_ids of the selected group.
* Use that in reporting or in a filter on the dashboard.
e.g.,
“My Group & Child Groups” → returns list of group sys_ids.
Dynamic Filter Script example:
(function getFilter() {
var selectedGroupId = gs.getUser().getCompanyID(); // replace with your logic to get selected group
var groupIds = [];
groupIds.push(selectedGroupId);
// recursively find child groups
var gr = new GlideRecord('sys_user_group');
gr.addQuery('parent', selectedGroupId);
gr.query();
while (gr.next()) {
groupIds.push(gr.sys_id.toString());
// you may add recursion here to get deeper levels
}
return 'managed_by_groupIN' + groupIds.join(',');
})();
Then in report:
managed_by_group = @{My Group & Child Groups}
Option 3: Custom Breakdown Source (if using Performance Analytics)
* Build a breakdown on managed_by_group
* In breakdown source, resolve each group to itself + its children
* This lets leaders see aggregate metrics including child groups
Best if you already have PA & want trend charts, scores, etc.
Option 4: Precompute & store
If performance is a concern and the hierarchy is stable:
* Precompute each group’s “full child group list”
* Store in a custom field (e.g., all_child_groups on group)
* Then use a simpler filter at runtime
Please appreciate the efforts of community contributors by marking appropriate response as Mark my Answer Helpful or Accept Solution this may help other community users to follow correct solution in future.
Thank You
AJ - TechTrek with AJ
LinkedIn:- https://www.linkedin.com/in/ajay-kumar-66a91385/
YouTube:- https://www.youtube.com/@learnitomwithaj
ServiceNow Community MVP 2025