Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

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,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.

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);

 

 

Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022

if(source.u_appl_install_status =="Installed"){return =1;}
else if(source.u_appl_install_status =="Retired"){return=7;}
else return 100;