Email notification script: catalog item variables and attachments; template.space();

 var item = new GlideRecord("sc_req_item");

item.addQuery("sys_id", current.sysapproval); item.query(); while (item.next()) { var set = new GlideappVariablePoolQuestionSet(); set.setRequestID(item.sys_id); set.load(); var vs = set.getFlatQuestions(); for (var i = 0; i < vs.size(); i++) { var sLabel = vs.get(i).getLabel() || '', sValue = vs.get(i).getDisplayValue() || ''; if (sLabel != '') { template.space(4); template.print(' ' + "<strong>" + sLabel + "</strong>" + " = " + sValue + "\n"); } } } var attachment = new GlideSysAttachment(); var agr = attachment.getAttachments('sc_req_item', current.document_id); if (agr.next()) { template.print(gs.getMessage("moj.notif.ritm_attachments_present")); }

Comments

Popular posts from this blog

GlideRecord setValue

Running transform maps asynchronously

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