Notification Body:
Hi Team, Please note that Incident list of unassigned Tickets. ${mail_script:incident.reminder.email} Please identify an appropriate owner and take necessary steps to resolve the Incident.
Email Script:
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template, /* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action, /* Optional GlideRecord */ event) { var html = ''; html += "<table border='1px solid #ce2127' style='font-size: 10pt;'><tr><th style='text-align:center;width: 85px;'><b>Number</b></th><th style='text-align:centerwidth: 100px;'><b>Assignment Group</b></th><th style='width: 100px;'><b>Created By</b></th><th style='width: 100px;'><b>Opened at</b></th><th><b>Short Description</b></th></tr>"; var app = new GlideRecord('incident'); //create a query to retrieve open approvals app.addEncodedQuery("numberIN" + event.parm1); app.query(); while (app.next()) { var number = "/incident.do?sys_id=" + app.sys_id; var URL = "<a href=" + number + ">" + app.number + "</a>"; html += "<tr><td style='width: 85px;'><b>" + URL + "</b></td><td style='width: 120px;'><b>" + app.assignment_group.getDisplayValue() + "</b></td><td style='width: 100px;'>" + app.caller_id.getDisplayValue() + "</td><td style='width: 100px;'>" + app.opened_at.getDisplayValue() + "</td><td>" + app.short_description + "</td></tr>"; } html += '</table>'; template.print(html); })(current, template, email, email_action, event);
How to add dynamic data in table format on the notification in ServiceNow