Way to populate List of related CI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2025 09:40 AM - edited 08-29-2025 09:47 AM
I have a requirement to have a UI action on incident table Affected CI related list which should popup ui page and populate the list of CI's that are related to the configuration item of the incident, currently I have created the logic where I am passing the value on cmdb_rel_ci and then populating the name in custom UI page but its not efficient way as cmdb_rel_ci have huge data, so its taking lot of time populate the list, can somebody please help me with above reuqirement if there is any OOTB method already available or any simpler and efficient way to achieve it
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2025 06:10 PM
Hi there @suyoga
There isn’t really no OOTB “show related CIs” popup, but you can do via your script by combining parent/child queries, bulk fetching, and possibly leveraging the CMDB Relationship API.
Query both parent and child in a single go with grRel.addQuery('parent', ciSysId).addOrCondition('child', ciSysId) so you cover both directions.
Use GlideAggregate or GlideQuery to fetch unique sys_ids directly, then bulk fetch from cmdb_ci (like you’re already doing with IN).
Keep your UI page only for display; do all heavy lifting in a Script Include that the UI Action calls with GlideAjax — that way it’s reusable and easier to maintain.
If performance is still an issue, consider CMDB Relationship API (/api/now/cmdb/relationship) which is more optimized for fetching related CIs.
Hope this helps.
Kind Regards,
Mohamed Azarudeen Z
Developer @ KPMG
