How can we fetch the sys_id or name from related CI of CMDB Service table
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 07:14 AM - edited 06-04-2024 07:18 AM
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 07:56 AM
try this:
var service_sysid = '<Service Sys ID>';
var cirelgr = new GlideRecord ( 'cmdb_rel_ci' );
cirelgr.addQuery ( 'parent', service_sysid );
cirelgr.addQuery ( 'type', '6afd799338a02000c18673032c71b87b' ); /*** sysid for the cmdb_rel_type Used by::Uses ***/
cirelgr.query();
if (cirelgr.next())
{
gs.info ( "Sysid for the related Service Offering:" + cirelgr.child );
}