Service Desk Practitioners Forum
cancel

Relations in the import mapping

Highlighted
Peter Dent
Outstanding Contributor.

Relations in the import mapping

I am trying to import CI data into SD 4.5, SP17.

I have an XML file and a working import mapping for the CI data.

What I want to do now is add a relationship to the import, to link the CI's to a Person record.

In the import data, which is an Excel file, I have the Searchcode of the related Person records which already exist within HPOV.

How do I create the link using the ECW and import mapping?
20 REPLIES
Darren McGiffen
Honored Contributor.

Re: Relations in the import mapping

since you have the xml you can do this directly from the system admin console.

create the import mapping using the cofiguration item and an empty template.

use a primary key binding as the Search Code for the CI (or some other unique field) and use the "Owner person" as the related person entity. Use the person Search Code for this field, otherwose, you'll need to select the field of the person value to enter into the "reference to item" it relates to.

i hope this info helps.

regards Darren
HP
Peter Dent
Outstanding Contributor.

Re: Relations in the import mapping

Darren,

Thanks for the reply but, that's not the field I want to populate.

Using the 'Standard' default configuration item form, click the Users tab, it is in there that I want to relate the user to the CI. Obviously I want to do this at the time of importing the CI's and not have to manualy update thousands of CI's.

The Owner field you specify is in our case the IT Department as the users do not own the equipment, they only use it.

Thanks anyway.
Robert S. Falko
Acclaimed Contributor.

Re: Relations in the import mapping

Peter,

In your import mapping, you must chose the item "CI User".

Once you have chosen this item, there are very few fields to map: the unique id of the user, and the unique id of the CI.

When you create your XML to import this information, you may either first import your users and CIs, and then, in a second step, import your users of CIs; or you can try to do both in one go.

To start, you might find it simpler to import the relations as a second step.

I do not use ECW to edit the .ini files, so I cannot really help you there. Once you have a couple of .ini files in place, I find it much simpler to copy one and then edit it directly.

Regards,
Josh
Peter Dent
Outstanding Contributor.

Re: Relations in the import mapping

Josh,

I thought you had cracked it there, it seems logical enough but, I did what you said and nothing happens?

I created a seperate import mapping for the 'CI User' entity.

I mapped the Person searchcode and the CI searchcode to the relevant fields in the import mapping. Ran the import and nothing happened, there are no errors while importing but, no relations appear either in the CI form or the Person form.

The Person records and the CI's already exist in the database.

Should I be mapping any other fields either in the person or the CI import?

What is the 'Users;User' field for in the CI mapping? I don't have anything mapped to that currently.

Also in the Person entity there is a field called 'Per. CI 1'

I have not got anything mapped to that either.

So in short, I still don't have any CI to User relations, am I missing something?
Peter Dent
Outstanding Contributor.

Re: Relations in the import mapping

I forgot to add that I didn't know which of the two fields in the 'CI User' entity to set as the unique key.

I think I tried each one and both of them together but it didn't seem to make any difference.

I would be very grateful for any further assistance.
Mike Khashan CA
Trusted Contributor.

Re: Relations in the import mapping

To build the relationships between the CI and the user, you have to create CI User if doesn't exists. Build your import mapping using the CI User, set the CI as the binding key, in this case you will get all CI's used by a person listed under the CI Used tab.

Good Luck,

Mike K- Canada
Robert S. Falko
Acclaimed Contributor.

Re: Relations in the import mapping

Peter,

I make both fields unique keys.

-Josh
Peter Dent
Outstanding Contributor.

Re: Relations in the import mapping

Hi, thanks for the offers of help but, it just doesn't work?

I have Users on the system and I have CI's on the system. When I run the import to try and link them, nothing happens. I do not get any errors or warnings.

I have an XML file containing the unique ID of the user and the unique ID of the CI.

I have an import mapping in which the fields are mapped to Configuration Item and User in the CI_User entity.

As I said I run it and nothing happens, there are no relationships setup.

What am I doing wrong?
Robert S. Falko
Acclaimed Contributor.

Re: Relations in the import mapping

Peter,

If the import is failing, there ought to be messages in the import log. What does it say?

-Josh
Peter Dent
Outstanding Contributor.

Re: Relations in the import mapping

Josh,

Sorry, didn't even think of that, Doh!

I don't understand it anyway?

There are only ten entries because I'm just using a subset of the data until I get it working. They are all assigned to the same User ID for the same reason.

I have attached the log file.

Thanks for your help with this.
Robert S. Falko
Acclaimed Contributor.

Re: Relations in the import mapping

Peter,

The problem is in your XML file. Oracle doesn't know what to do with the query because of a data type mismatch. Unless the value for "TYPE" in the XML file is something wierd, your problem is in the data itself.

Posting a sample of the XML file that corresponds to the log just posted might help.

-Josh
Peter Dent
Outstanding Contributor.

Re: Relations in the import mapping

Josh,

OK, attached is the XML file, small becasue I'm only using ten records at the moment.

Thanks.
Peter Dent
Outstanding Contributor.

Re: Relations in the import mapping

Could it be something to do with the CI Search code?

In our Org. the unique ID for a piece of kit is the asset number.

However you cannot have a CI searchcode that starts with a numeric so, I have put the # (hash) sign in front of the asset no.

That is what is used as the CI search code.

The CI's exist on the system and they were imported ok with that format of search code and unique id.

Robert S. Falko
Acclaimed Contributor.

Re: Relations in the import mapping

Peter,

You can confirm your hypothesis by changing the searchcode of a CI, removing the # in both OVSD and in the XML and then trying again. I do not see what else the problem could be.

I have never tried to use # in a search code - we use or 2 or 3 letter character prefix followed by a dash in order to get around the no initial digit problem.

If it turns out that the # is the problem, you should ask HP to fix this because it is clearly a bug - the program does not work as documented.

Sorry,
Josh
Peter Dent
Outstanding Contributor.

Re: Relations in the import mapping

Josh,

I have removed the # prefix. I have tried NSC-12345-XP, also tried NSC12345XP, as a CI SearchCode value and I still get the same error.

Invalid Number in the SQL execution, its not even getting as far as the database before going into error.

JDBC error 1722: ORA-01722:

I Google'd this error code and its seems like this error is thrown up for all sorts of reasons depending on the applications being used.

But it seems like an error in the Oracle SQL rather than the data or the mapping.

I don't know where to go from here?

Is it possible you could post a samle of the XML file that works for CI_User on your system?

I'll speak to our Oracle guy tomorrow.

Thanks.
Robert S. Falko
Acclaimed Contributor.

Re: Relations in the import mapping

Peter,

In my opinion, your XML file is fine.

-Josh
Peter Dent
Outstanding Contributor.

Re: Relations in the import mapping

Josh,

I have tried various combinations, without sucess.

I have logged a call with HP.
Peter Dent
Outstanding Contributor.

Re: Relations in the import mapping

Josh,

Please can you tell me about the Import Mapping you would use to import data into the CI_User entity.

When creating the import mapping you must specify a Template for the entity.

Which Template would you use?

I used a template which I created based on the CI_User item in the Template list. I just left all the fields blank in the template.

But, on closer inspection I realise that the template does not have a field for the CI unique ID.

If the import mapping is going to use this template then it needs to have a field into which it can put the CI unique ID, doesn't it?
Robert S. Falko
Acclaimed Contributor.

Re: Relations in the import mapping

Peter,

Even though there is no field on the template for the CI, that is not a problem. Certain fields come up by default in the mapping part, even though they are not on the template.

Of course, this means that it is not easy to use DataExchange to say that a single CI is used by a large number of users - but I suppose this is not a significant requirement.

From everything you have said till now, it appears to me that your import should work. One technique in OVSD when seemingly irrational errors occur is to stop everything, clear out the cache, and start up again.

-Josh
Peter Dent
Outstanding Contributor.

Re: Relations in the import mapping

Josh,

I've solved it!

My ignorance, but, this is the first time I have tried importing relations so.....

In the import mapping there is a drop down list entitled - "A reference to item"

(see attached Word doc)

I didn't know what this was for, never used it before. Now of course I realise.

You have to choose the data item to which the field in the XML file relates.

This tells the system to insert the reference, (OID) to the item named in the xml file, rather than trying to insert the actual value of the data.

That's why it was giving the 'Invalid Number' error. Its all clear when you know the answer.

HP never got back to me, they never do. 2Hr response time my a£$e!

I'm going to give you some points just for sheer persistance and sticking with me.

Thanks for your support.