- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2025 05:32 AM
Hello team,
I wanted to learn how category and subcategory is auto populating in cmdb_ci records....can someone please help me out?
When i checked in dictionary of those attributes then i found it as "Use dynamic value" was checked as "true" and under dynamic filter option this "gs.include("CMDBItem");var item = new CMDBItem(current);item.setCategory();" script was return.
can you please help out in understanding this script and what happens if i disable it?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2025 06:07 AM
Hi,
The script include CMDBItem based on data from the cmdb_categories table. For example, a windows server (cmdb_win_server) has a category of Hardware, and a SubCategory of Computer.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2025 06:07 AM
Hi,
The script include CMDBItem based on data from the cmdb_categories table. For example, a windows server (cmdb_win_server) has a category of Hardware, and a SubCategory of Computer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2025 06:08 AM - edited ‎02-21-2025 06:09 AM
Hi @Suhail2297
CMDBItem is a script include where it's checking for the category and subcategory linked to the ci record (ci class).
cmdb_categories is a table where you can get the relationship details between category/subcategory and ci class.
I hope this helps.
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2025 06:42 AM
Can you please explain that script include to me here

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2025 06:59 AM
- setCategory is called by the dynamic filter
- If the item already has a category, it won't update the value
- The script then calls _getCategory() to get category information for CMDB Classes
- getCategory attempts to retrieve category information from the cache CMDB_CATEGORIES_CACHE which is in memory. This avoids needing to lookup on the cmdb_categories for each new CI which is an expensive operation
- The category and subcategory are determined based on the class of the CI, which is stored in sys_class_name. So for a windows server, this is cmdb_ci_win_server