PERSPECTIUM: how to map an attachment file in the inbound transform map

onAfter script:

INCIDENT EXAMPLE:
//--Attachments handling:
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
    //gs.log('--test attach');
   
    if (source.u_attachments.nil()){
        return; // noop
    }else{
        //gs.log('--test attach 2');
        var pspAtt = new PerspectiumAttachment();
       
        var xmldoc = new XMLDocument(source.u_attachments);
        var nodelist = xmldoc.getNodes("//attachment");
        if (nodelist == null){
            return; // noop
        }
        for (var ii=0; ii < nodelist.getLength(); ii++) {
            var nodeItem = nodelist.item(ii);
            pspAtt.addAttachment(nodeItem, "incident", target.sys_id, "msp_client_incident_sent");
        }
    }
})(source, map, log, target);
-------------------------------------------

PROBLEM EXAMPLE:

pspAtt.addAttachment(nodeItem, "problem", target.sys_id, "msp_client_problem_sent");

Comments

Popular posts from this blog

Running transform maps asynchronously

Post a command to the ECC queue for the mid server to initiate a powershell file copy

GlideRecord setValue