Service Desk Practitioners Forum
cancel

Importing Parent/Child relationships

SOLVED
Go to solution
Highlighted
Jake Lundberg (
Outstanding Contributor.

Importing Parent/Child relationships

I'm trying to import parent child relationships that have been created via excel spreadsheet. The spreadsheet was created using a dump with all the search codes for our CIs. We match up parent child relationships 1:1 like:

Parent1 Child1
Parent1 Child2
Parent1 Child3
Parent2 Child4
Parent2 Child5
Parent2 Child6

I've already built the import mechanism and it appears to be working. The problem is, when I try to import, it's looking for the OIDs, not the search codes and this is causing datatype conversion errors from the database (and rightfully so). Does anyone know of a way to import parent/child using search code vs. OID?
It is your mind that creates this world
5 REPLIES
George M. Meneg
Acclaimed Contributor.

Re: Importing Parent/Child relationships

Hello Jake,

At the CI Component import mapping, have you define that PARENT_SEARCHCODE is reference to SEARCHCODE and CHILD_SEARCHCODE is reference to SEARCHCODE ?

Have a look at the attached doc
menes fhtagn
Jake Lundberg (
Outstanding Contributor.

Re: Importing Parent/Child relationships

Thanks George,

BTW, this is 4.5 SP17.

Yes, I have defined that relationship. When I run the import however, it gives me an error:

JDBC error 8114: [SVR2K3TEST\SERVICEDESK]Error converting data type nvarchar to numeric., SQL state: 01000 for query: SELECT T1.cic_oid AS C0 ,T1.cic_lockseq AS C1 FROM itsm_cicomponents T1 WHERE (T1.cic_cita_oid = ?) AND (T1.cic_citb_oid = ?) Values: FTP ACE1java.sql.SQLException: [SVR2K3TEST\SERVICEDESK]Error converting data type nvarchar to numeric.


This actually makes sense to me, because the table I'm importing to doesn't have search code in it, just foreign keys to the actual CIs. I'm guessing if I put the OIDs in there instead this will go w/out a hitch, but it's not preferred. Also, this is something of a two step process where users can import new CIs and then the parent/child relationships for them, so we may not even know the OIDs until after the initial import process. Besides, OIDs are hardly user friendly.
It is your mind that creates this world
George M. Meneg
Acclaimed Contributor.
Solution

Re: Importing Parent/Child relationships

Hello Jake,

If the columns contain "OIDS" then its expected that the import will fail, since you are mapping decimal(18,0) to searchcode and service desk doesn't want searchcode to start with a digit. If you concatenate a character in the beginning of the OID then the import will be successful.
menes fhtagn
Jake Lundberg (
Outstanding Contributor.

Re: Importing Parent/Child relationships

Thanks again George,

I see what I did wrong. I didn't actually have the reference column selected so it couldn't resolve the foreign keys I'm guessing. That solved the problem.
It is your mind that creates this world
Jake Lundberg (
Outstanding Contributor.

Re: Importing Parent/Child relationships

See above
It is your mind that creates this world