How can I apply CI Identifiers to manually created CI's in SNOW; using CMDBTransformUtils()

mathuranuneeti
Kilo Expert

Hi,

I have to apply CMDB identification rules to manually created CI's along with those coming from discovery. Can anyone help how to use CMDBTransformUtils() script include in a before insert update business rule.

Thanks

Anuneeti

4 REPLIES 4

glennpinto
Kilo Guru

I queried development and this is what I was provided in response.




"Calling createOrUpdateCI() or CMDBTransformUtils() scriptable API directly in a BR is not recommended. Creating a BR for manually inserting/updating a CI and then within that BR directly calling createOrUpdateCI() or CMDBTransformUtils() API can cause recursive triggering of this BR, since these APIs internally will again trigger insert/update operation. Platform also don't recommend that in BR (Prevent Recursive Business Rules)



I will suggest the following for manually entering Cis in CMDB that should go through identification/reconciliation engine:


  1. Instead use Import Sets with CMDBTransformUtils() API to do this (link)
  2. Create a simple Service Catalog, that takes in CI class, and which attributes needs to be populated, and it internally call createOrUpdateCI() API.

Hi Glenn,




I have a scenario where we are using AppD integration to import data into CMDB; however this does not uses any transform maps & integration is directly creating or updating the CIs due to which its creating multiple issues with reconciliation & reclassfication of CIs. Is there a way we can use identification/Reconcilation API in this kind of scenario to restrict the attributes updates & reclassification( i have already tried with recon & precedence but no luck) as its not checking the iden/recon apis? Kindly suggest how we can use these Identification/reconciliation engine?



Regards,


Pravin


Hello Glenn,



I hope you are doing well.



I have some queries regarding CI Imports, where customer needs 3 custom fields named Category, Type & Item in Server, Application, Database, Business Service & Business Process classes. Should I create these fields directly in the cmdb_ci class which will help me to pull the same in all other classes, as per the best practice approach?



Also, how should I proceed with the CI Identification rule + Reconciliation Definitions & Data Source Precedence here? Would it be configured before importing all the CI's in the above classes or post import?



Awaiting for your help here.




Thanks,


Hussain K


AnkitJ005004676
Tera Contributor

Dear @mathuranuneeti ,

 

while running transform map, apply the transform script 

Transform Map: Run script to invoke IRE for specfic Table
(function runTransformScript(source, map, log, target) {
// Call CMDB API to do Identification and Reconciliation of current row
var cmdbUtil = new CMDBTransformUtil();
cmdbUtil.identifyAndReconcile(source, map, log);
ignore = true;

if (cmdbUtil.hasError()) {
var errorMessage = cmdbUtil.getError();
log.error(errorMessage);
} else {
log.info('IE Output Payload: ' + cmdbUtil.getOutputPayload());
log.info('Imported CI: ' + cmdbUtil.getOutputRecordSysId());
}

})(source, map, log, target);

 

this works for me!!!