Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Update software package from software instance

Community Alums
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