Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Update software package from software instance

Not applicable

Hi all,

I'm struggling with this script, when a software instance is inserted or updated to create a new software package, however to also look for any duplicates but I'm either getting the result of a blank record or none at all. 

 

 

 

(function executeRule(current, previous /*null when async*/ ) {
    var spkg = new GlideRecord("cmdb_ci_spkg");
	spkg.addQuery("name", current.sys_id.toString());
    spkg.query();
    if (spkg.next()) {
        spkg.name == current.name;
        spkg.insert();
    } else {
        spkg.setAbortAction(true);
    }
})(current, previous);

 

 

 

 

0 REPLIES 0