Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2023 03:14 AM
Hi All,
I need to pass the instance name in the subject of the notification how this can be achieved ?can we do it in what it contains option or separate notification email script?
below is the existing notification email script for body
(function runMailScript(current, template, email, email_action, event) {
var instancename1 = gs.getProperty("instance_name");
gs.log("testcountisstarting");
var event = new GlideRecord('sysevent');//new
event.addEncodedQuery('sys_created_onONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()^stateNOT INprocessed,error,transferred^processedISEMPTY');
event.query();
if(event.next())
gs.log("ifevent");
var count = event.getRowCount();//new
gs.log("testcountis"+count);
//if (count >1000) {
if (count >= 1) {
var count2 = event.getRowCount();//new
//
template.print(instancename1+" "+ "event processing is stuck please check.The event count is"+" "+ count2);
}
})(current, template, email, email_action, event);
Solved! Go to Solution.