Which table to use to batch upload CI Relationships?

jancaasi
Mega Expert

Hi Everyone, I am trying to locate the table to use to update the relationships of the CIs that we have. May i know which table to use? Thanks, Jan Raphael Caasi

1 ACCEPTED SOLUTION

larstange
Mega Sage

Hi Jan



There are no OOTB table you can use for this purpose.


You will have to create your own import table and a transform map to create the relationships.



The relationships must be imported into the cmdb_rel_ci table and there are three fields to fill out - Parent, Child and Type.



The full way is to create a data import set


- Import Sets - ServiceNow Wiki



A quicker way is to create an "Easy import" if you are not familiar with the transform engine


- Easy Import - ServiceNow Wiki


View solution in original post

5 REPLIES 5

larstange
Mega Sage

Hi Jan



There are no OOTB table you can use for this purpose.


You will have to create your own import table and a transform map to create the relationships.



The relationships must be imported into the cmdb_rel_ci table and there are three fields to fill out - Parent, Child and Type.



The full way is to create a data import set


- Import Sets - ServiceNow Wiki



A quicker way is to create an "Easy import" if you are not familiar with the transform engine


- Easy Import - ServiceNow Wiki


ckoss
Kilo Contributor

..  Booldy SN Newbie facing some Questions..

 

Is this still the way on how to Import  "related CI´s" (3 Years after..) ? Best practice?

we have tons of related CI´s in our source CMDB.. e.g. Computers from a structure like:

Computer-Asset  ----> ComputerCI(1..n) ------> ComputerComponent(1..n)

We need to Import those CI´s into SN.

Issue 1: Relation?

we managed to (just) import the (single) sources (e.g. Asset, Computer, Component, other,..) into Tables in SN..no problem....but what is the best (smart) way to  give them back the linkage they had in their Source-System?

Issue 2:  SYS_ID !? ( only visible in the URL !? )

Wired with our problem from above is that in some REST examples (https://docs.servicenow.com/bundle/madrid-application-development/page/integrate/inbound-rest/concept/cmdb-instance-api.html#cmdb-instance-DEL-cls-sys-rel-sys)

we saw that if we try to "relate" our CI´s via REST we would need the SYS_ID....But this sys_id only seem to be accessible via the URL!?  we tried some "tricks" (e.g. https://community.servicenow.com/community?id=community_question&sys_id=e6d1c7a9db98dbc01dcaf3231f961902) - but unfortunately this ID is still not in the computer-List..

we can imagine that this kind of Migration from an existing Environment INTO SN is such an essential Task and we just oversaw the trick or the hint what's the best Practice on how to handle this!?

 

many thanks

Christine

 

 

 

iadityas
Mega Expert

Hi Jan,



You need to use cmdb_rel_ci table having 3 reference fields: Parent (referenced from cmdb_ci), Child (referenced from cmdb_ci) and Type (CI Relationship Types).


Make sure you have Relationship Types created and no duplicates in the data you are putting in Parent/Child field. Use Import Sets/Transform Maps to perform the upload. Write Transformation or other scripts to handle any duplicates using sys_id to act as Coalesce.


Hope that helps.



Thank You!



Regards,


Aditya Shrivastava


Thanks for the information. 🙂