Model IDs Update

_bhishek
Tera Guru

Hi All,

 

In our CMDB ,CIs are mapped with incorrect models.I have exported data in column as correct model Ids sys ID and respective incorrect model IDs sys ID .

Could you please help me how can i create transform map script like when imported incorrect model IDs  sys ID  match with current model ID  sys Id of CI then Model ID should be updated correct model ID.

 

Thanks.

2 REPLIES 2

_bhishek
Tera Guru

Hi All,

 

Did you get chance to look into it .Any suggestion would be helpful.

 

 Thanks.

_bhishek
Tera Guru

Hi All,

 

I have written below script for MOdel ID field map. Could you please tell me what is wrong in it?

answer = (function transformEntry(source) {
    var gr = new GlideRecord('cmdb_ci');
    gr.addQuery('current.model_id.sys_id' , 'source.u_old_model_sysid');
    gr.query();
    if (gr.next()) {
        return 'source.u_new_model_sysid';
    }
})(source);
 
Thanks.