Automatically Create CI Relationship Based on Reference Field

CamSilv
Giga Contributor

Hi All

Is it possible to create CI relationships based on a reference field within the CI? e.g.

Discovering Azure Storage Accounts, I have a reference field that is populated with the Resource Group CI that contains it. I would also like a relationship that identifies the storage account is dependent on the resource group.

For a VM I would like it to automatically create a relationship to the resource group that contains it, as well as the storage account that holds it's data. Both of which I can populate during discovery.

Thanks
Cam

3 REPLIES 3

CamSilv
Giga Contributor

I've seen that relationships appear to be held in a table called cmdb_rel_ci. I'll see If I can use REST to create these, as that would fit in perfectly with what I'm doing.

I'll report back if I get anywhere.

Yes relationships are stored in the cmdb_ci_rel table.  An easier method would be to create a business rule on your table that automatically creates the relationship on insert/update of the value in that reference field.

Great, thanks. I'll have a look.

Ta
Cam