install_status in cmdb_ci table picks default status "installed"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2020 03:12 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2020 09:45 AM
Hi,I have pasted the code above. In the field map page there is choice action = "Create" and my Target Field="install_status".Nothing else is there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2020 10:54 AM
Set the choice action to ignore
//Try this code
answer = (function transformEntry(source) {
var result;
gs.log("install status received :" + source.u_appl_install_status.trim());
if (source.u_appl_install_status.trim() == "Installed") {
result = 1;
} else if (source.u_appl_install_status.trim() == "Retired") {
result = 7;
}
else {
result = -100;
}
gs.log("result Status :" + result);
return result; // return the value to be put into the target field
})(source);
Vinod Kumar Kachineni
Community Rising Star 2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2020 09:52 AM
if(source.u_appl_install_status =="Installed"){return =1;}
else if(source.u_appl_install_status =="Retired"){return=7;}
else return 100;