Can we have same CI names belonging to 2 different classes in CMDB? If yes, then how do we perform relationship data load into system?

iadityas
Mega Expert

Can we have same CI names belonging to 2 different classes in CMDB? If yes, then how do we perform relationship data load into system?

18 REPLIES 18

Hi Chuck,



Before attempting to load the data using import sets, I tried to perform the same from UI but it gave me an error so of course I wont be able to load that data successfully.



CI Relationships.jpg



If you can suggest me an alternate way to load, CI Data and CI Relationships data, it will be great help!!




Regards,


Aditya


Are you certain your parent and your child are two separate CIs? When you select values from the reference field, it doesn't care what the names are, it only cares about sys_ids and that they are unique. When you submit it is double checks that parent != child and you do not have a loop somewhere, for example



a is the parent of b, b is the parent of c, and c is the parent of a.


Hi Chuck,



In order to ensure I am selecting correct Parent/Child values, I have exposed cmdb_rel_ci.Parent.Name = ABC and cmdb_rel_ci.Child.Name = ABC as shown in screen capture however both Label are same as Name.



Regards,


Aditya


Hi Chuck,



The BR on cmdb_rel_ci giving error is as simple as this.



BR: Prevent Recursion in CI Relationships


Condition: current.child == current.parent


Advanced:


/**


Service-now.com


Description:   Parent can't match Child


**/


current.setAbortAction(true);


gs.addErrorMessage(


gs.getMessage("The recursive relationship") + " '" +


current.child.getDisplayValue() + " <i>" + current.type.name + " </i>" + current.parent.getDisplayValue() + "' " +


gs.getMessage("is not allowed and has not been established"));



====================================================


Both Parent and Child are Reference fields on cmdb_rel_ci table referring to Configuration Item from cmdb_ci table.


With this one can not build relationship for those CI for which Parent CI Name is same as Child CI Name even if they belong to different classes.



What is the rationale behind this?


What is the way to overcome this?



Please let me know. Thank You!



Regards,


Aditya


Hi Aditya,



At this point I'm going to have to refer you to support. I've run out of ideas.