Update software package from software instance
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 02:02 AM
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