How to avoid creating many transform maps or maybe automate it if not possible.

Siddhesh Gawade
Mega Sage
Mega Sage

We are creating ESX servers so we load data into cmdb_ci_esx_server class which in turn creates corresponding CI  and the asset. The same applies to the Server class (cmdb_ci_server) and other CI classes.  Though this approach is desirable and less error-prone, but it requires us to create transform maps of each class separately.    

So I want to be able to upload these asset using one transform map but it creating the assets on the windows server table or linux server table or computer peripheral table

When I put on the highest point of the table, we don't get any suggested parent- child relationship and CMDB just truly doesn't recognized it
 

Please guide and let me know how we can automate it and avoid creating many transform maps ?

Regards 

Siddhesh

1 ACCEPTED SOLUTION

Sulabh Garg
Mega Sage
Mega Sage

Hello Siddhesh

One way I can think of to create field map of "Class" field (sys_class_name) where you can define the backend table name of each class, e.g: 'cmdb_ci_esx_server' or 'cmdb_ci_server' and this should present in your source file (csv or excel).

Using above approach you can build your transform on "cmdb_ci" table instead of individual class tables.

Hope it helps!!

 

Please Mark Correct/helpful, if applicable, Thanks!! 

Regards

Sulabh Garg

Please Mark Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg

View solution in original post

14 REPLIES 14

Hi Siddhesh,

I do not understand my product models are getting duplicated. If you do not want to rely on higher level and want to build transform map for lower-level classes then you will end up creating the multiple transform map which I believe you want to avoid in the original questions. Correct?

Please Mark Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg

Hi Sulabh,

Yes you are correct we don't want to create multiple transform maps for individual lower-table. 

I have created transform map for(cmdb_ci) higher level table.

and we have fetching data to lower-level tables e.g. cmdb_rel_ci, alm_hardware, cmn_location, cmdb_hardware_product_model etc.

in which there are some tables are not extends cmdb_ci table.

So we are doing scripting to maps individual tables.

Every thing is working fine, fields are getting mapped to lower-level tables.

but because of target table is cmdb_ci we are not able to use coalesce field to other lower-level tables and it will create duplicate entries.

So we are using business rule to avoid duplicate entries as follow:

var gr = new GlideRecord('cmdb_ci_server');

gr.addQuery('name',current.name);

gr.query();

if(gr.next()) { current.setAbortAction(true);

gs.addErrorMessage("A DEVICE WITH THAT NAME ALREADY EXISTS, PLEASE SEARCH THE CMDB BEFORE CREATING NEW RECORDS");

}

but we have to create business multiple business rule for many tables

We don't want create that much business rule, So do you have any script or any suggetions to avoid duplicate entries using single script for all tables?

also do you have any suggetions ? 

Regards,

Siddhesh 

 

Hello Siddhesh,

Now I understand your concern.

Instead of creating multiple business rules to avoid duplicates, you need to utilize the IRE Engine (Identification and reconciliation engine) for CMDB as this is the best practice recommended by ServiceNow to avoid duplicates in CMDB.

Here you need to create the Identification rules for each CI class (there are some already there in OOB CI classes) to avoid the duplicates in CI class.

For more Information please visit below link

Identification and Reconciliation engine (IRE)

 

Please Mark Correct/helpful, if applicable, Thanks!! 

Regards

Sulabh Garg

Please Mark Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg

@Siddhesh Gawade - I hope my answer helped you in building the solution, Please let me know if any follow up is required here, If not, Please mark my response as helpful and correct so that this thread can be closed.

Thanks

 
Please Mark Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg

Hello @Sulabh Garg 

I am using import set process to transform data from excel sheet.  I am transforming this data to five different lower-tables(like  [cmdb_hardware_product_model, alm_hardware, cmdb_ci, cmdb_rel_ci, cmn_location). and it is working as expected. There is a one column for product model present in excel sheet. When I do data transformation this product models are getting duplicated, we tried using coalesce field but this is not working. is there is any obb functionality related to product models or am I missing somethings

Do you have  any thoughts or suggestions?