How to find related items for a CI

Peter Farr
Giga Contributor

Given a GlideRecord for a particular CI how does one find all the related CIs? For example, a search has returned me a GlideRecord for a cmdb_ci_network_adapter or cmdb_ci_ip_address entry and I want to find the Computer class it is related to. I am probably being dense, but it doesn't seem obvious to me.

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

The table that contains the CMDB CI relationships is called cmdb_rel_ci. It will give you a parent and a child to tell you whether the CI is a parent of another (e.g. a server to an app) or the child (e.g. database to an app). If you need to find out a top level service or if another CI is part of the relationship hierarchy then you will need to do a little more gliderecord query through the cmdb_rel_ci table to find what you are looking for. This may involve recursion which is a bit of a more advanced scripting topic.

View solution in original post

5 REPLIES 5

Chuck Tomasi
Tera Patron

The table that contains the CMDB CI relationships is called cmdb_rel_ci. It will give you a parent and a child to tell you whether the CI is a parent of another (e.g. a server to an app) or the child (e.g. database to an app). If you need to find out a top level service or if another CI is part of the relationship hierarchy then you will need to do a little more gliderecord query through the cmdb_rel_ci table to find what you are looking for. This may involve recursion which is a bit of a more advanced scripting topic.

hi @Chuck Tomasi 

 

how can i find the query used for fetching data in this related item from cmdb_rel_ci . Couldnot find that in sys_relationship 

find_real_file.png

 

Did you find an answer to your question? I am trying to do query something similiar.

VigneshMC
Mega Sage

All CI relationships are stored in "cmdb_rel_ci" table. You can query this to get information about relationships.