
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2022 01:26 AM
Hi All,
Below is a CI which is within a Dynamic CI Group (All EUC Computers). In the dependency view i have a related services tab which shows this relationship.
But if i was writing a script...How could i find the Dynamic CI Group's that this CI is in?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2022 10:02 PM
HI Edward,
The relationships are held in the svc_ci_assoc table.
But note that the relationships are not just for CI and Dynamic CI Groups. It is for CI and all extensions of the cmdb_ci_service_auto class, which includes cmdb_ci_query_based_service a.k.a. Dynamic CI Group.
So if you wanted to get only Dynamic CI groups you would need to modify your query to look for only cmdb_ci_query _based_service records.
Eg:
var gr = new GlideRecord('svc_ci_assoc');
gr.addEncodedQuery('service_id.sys_class_name=cmdb_ci_query_based_service');
gr.query();
Regards,
Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2022 10:02 PM
HI Edward,
The relationships are held in the svc_ci_assoc table.
But note that the relationships are not just for CI and Dynamic CI Groups. It is for CI and all extensions of the cmdb_ci_service_auto class, which includes cmdb_ci_query_based_service a.k.a. Dynamic CI Group.
So if you wanted to get only Dynamic CI groups you would need to modify your query to look for only cmdb_ci_query _based_service records.
Eg:
var gr = new GlideRecord('svc_ci_assoc');
gr.addEncodedQuery('service_id.sys_class_name=cmdb_ci_query_based_service');
gr.query();
Regards,
Martin