install_status in cmdb_ci table picks default status "installed"

Chinmayee1
Giga Contributor

Hi All, 

I am getting the cmdb CI records from an external source to cmdb_ci_appl table through a staging table. I am getting correct values for install_status in staging table in a string field. When I transform it to cmdb_ci_appl from staging , by default all the install_status are updated as "installed". Can someone advise me on how to get the correct install status to cmdb_ci_appl table ?

 

Thanks & Regards,

Chinmayee Mishra

12 REPLIES 12

Hi,

so this is the field map for that drop down

try with using toString() before returning

answer = (function transformEntry(source) {
var result;
gs.log("install status received :"+source.u_appl_install_status);
if(source.u_appl_install_status == "Installed"){result=1;}
else if(source.u_appl_install_status == "Retired"){result=7;}
gs.log("result Status :"+result);
return result.toString();

})(source);

Regards
Ankur

Tried this. No Luck.

vkachineni
Mega Sage

The default value is 1. 

The code has only if- else if

there is no default handler

What happens when you get something other than "Installed" or "Retired"?

 

find_real_file.png

I added the else statement at the end but still the same.

Can you post the field map screenshot