When | Order | Script |
---|
onBefore | 80 | (function runTransformScript(source, map, log, target /*undefined onStart*/ ) { if (source.u_comments.nil()) return; var sgr = new GlideRecord("sys_journal_field"); sgr.addQuery("name", target.getTableName()); sgr.addQuery("element", "comments"); sgr.addQuery("element_id", target.sys_id); sgr.addQuery("value", source.u_comments); sgr.query(); if (sgr.next()) ignore = true; })(source, map, log, target); |
onBefore | 85 | (function runTransformScript(source, map, log, target /*undefined onStart*/ ) { if (source.u_caller_email.nil()) { return; } var gr = new GlideRecord("sys_user"); gr.addQuery("email", source.u_caller_email); gr.query(); if (gr.next()) { target.caller_id = gr.sys_id; } })(source, map, log, target); |
onAfter | 90 | (function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
var pspS = new PerspectiumEncryption();
var pspR = new PerspectiumReplicator();
var ogr = new GlideRecord("psp_out_message");
ogr.addQuery("state", "deferred");
var orQc = ogr.addQuery("u_extra", "CONTAINS", "number=" + source.u_number);
orQc.addOrCondition("u_attributes", "CONTAINS", target.sys_id);
ogr ogr updatevaluewithcorrelationidbeforesendout vardecodeData=pspS.decryptString(ogr.value); decodeData = decodeData.replace("<correlation_id/>", "<correlation_id>" + target.correlation_id + "</correlation_id>");
if (decodeData.indexOf("</attachments>") > -1) {
ogr.name = ogr.name.replace("update", "attach");
}
ogr.value = pspS.encryptStringWithCipher(decodeData, "3");
ogr.u_extra = "";
ogr.state = "ready";
ogr.update();
}
})(source, map, log, target);
onAfter | 95 | (function runTransformScript(source, map, log, target /*undefined onStart*/ ) { if (!source.u_correlation_id.isNil()) { return; } var pspR = new PerspectiumReplicator(); var ds = new GlideRecord("psp_replicate_conf"); ds.addQuery("u_target_queue.u_name", "psp.in.meshlet.ivanti"); ds.addQuery("active", "true"); ds.addQuery("sync_direction", "share"); ds.query(); if (!ds.next()) { return; } var gr = new GlideRecord("incident"); gr.addQuery("sys_id", target.sys_id); gr.query(); if (gr.next()) { pspR.shareRecord(gr, "incident", "update", ds.sys_id); } })(source, map, log, target); |