CI / Asset not auto-creating on bulk import

AndyB5000
Mega Guru

I am preparing a large set of data to import into our CMDB and to test I am using a sub-set of about 25 records.  When I use the transform map to create the records they are created on the alm_hardware table but the associated CI is not being auto-created as expected.  I tried doing the reverse and imported the CIs but the assets were not auto-created as expected.

I know I have done this before without issues and cannot figure out what I am missing.

1 ACCEPTED SOLUTION

@AndyB5000 ,

You are mapping u_model directly to model_id field, and you are not mapping model category at all.  Both are required to create an asset correctly and create a resulting CI.  This is the cause of your issue. 

Model: Since there is no source script used here, and presumably the value of u_model is not a sys_id of a Model reference, this won't work.  You need to provide a reference to a valid model.  My recommendation would be to use a combination of u_manufacturer (if available) and u_model, and then use MakeAndModelJS script to automatically obtain or create a valid model reference on the fly.  If you do not have u_manufacturer available in your data source, you will need to determine an appropriate method to supply a valid model reference, or else this will not work correctly, because it cannot determine what model to use.

Model Category: This is typically something that you will have to provide some customized logic for, depending on your data source.  Like model, it has to be a reference (sys_id) to a model category.  It's not a String field.  So you will need to map the information from your data source to an appropriate model category in your system.

Please mark as helpful and as correct answer if this resolves your issue.

Paul


The opinions expressed here are the opinions of the author, and are not endorsed by ServiceNow or any other employer, company, or entity.

View solution in original post

13 REPLIES 13

Also, maybe attach an image of the transform map if you think it may help.

Sylvain Lacombe
Tera Contributor

There are 2 business rules you may want to consider reviewing:

- Create Asset on insert

- Create CI on insert 

 

The Create CI on insert is coming from the alm_asset table, not the alm_hardware table. 

Perhaps you want to load against alm_asset instead of alm_hardware? 

 

Cheers, 

Sylvain

Just to clarify....the Create Asset business rule is for the alm_asset table but executes on the extended table (alm_hardware) as well.  The condition will not allow it to execute on the alm_consumable or alm_license tables...

Condition:  current.sys_class_name != 'alm_consumable' && current.sys_class_name != 'alm_license' && current.ci.nil() && current.substatus != 'pre_allocated' && current.model_category.cmdb_ci_class != ''

 

So loading to the alm_hardware shouldn't be a problem.

 

-Akash

AndyB5000
Mega Guru

I have attached a screenshot of the transform map...

 

I did a test and imported the data to the alm_asset table and same thing occurred.  BR to create the CI is not running.

@AndyB5000 ,

You are mapping u_model directly to model_id field, and you are not mapping model category at all.  Both are required to create an asset correctly and create a resulting CI.  This is the cause of your issue. 

Model: Since there is no source script used here, and presumably the value of u_model is not a sys_id of a Model reference, this won't work.  You need to provide a reference to a valid model.  My recommendation would be to use a combination of u_manufacturer (if available) and u_model, and then use MakeAndModelJS script to automatically obtain or create a valid model reference on the fly.  If you do not have u_manufacturer available in your data source, you will need to determine an appropriate method to supply a valid model reference, or else this will not work correctly, because it cannot determine what model to use.

Model Category: This is typically something that you will have to provide some customized logic for, depending on your data source.  Like model, it has to be a reference (sys_id) to a model category.  It's not a String field.  So you will need to map the information from your data source to an appropriate model category in your system.

Please mark as helpful and as correct answer if this resolves your issue.

Paul


The opinions expressed here are the opinions of the author, and are not endorsed by ServiceNow or any other employer, company, or entity.