- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 12:19 AM
Hi Team,
We are working on SLA notifications, below is the example of the notification that got triggered when an event is fired (75 % breach)
sub : SLA "XYZ- P3 resolution (2 days)" associated with INC0017809 has reached 75.02% of its allowed duration
Now we have to make the 75.o2 to 75 only
what is the easiest way to achieve it ?
Regards
B Sva Teja
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 03:01 AM
It comes from this OOTB Notification:
https://instanceName.service-now.com/nav_to.do?uri=sysevent_email_action.do?sys_id=9660628ed7a2220035ae23c7ce61039e%26sysparm_view=advanced
Steps to achieve
1) remove the subject from subject field
2) then update any of the existing email script and set the subject. I selected this "sla.salutation.event_parm1"
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var breachPercentage = parseInt(current.business_percentage);
gs.info('ARB breachPercentage' + breachPercentage);
var subject = "SLA " + current.sla.getDisplayValue() + " associated with " + current.task.number + "has reached " + breachPercentage + "%";
email.setSubject(subject);
var user = GlideUser.getUserByID(event.parm1);
if (user.exists())
template.print(gs.getMessage("Hello {0},", user.getDisplayName()));
else
template.print(gs.getMessage("Hello,"));
})(current, template, email, email_action, event);
Output: When I previewed the notification
The percentage 13.78% got converted to 13
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 02:44 AM
which OOTB notification is being used here? share the name and screenshot
I already informed the logic
something like this to convert decimal to integer
var myIntegerValue = parseInt(decimalValue);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 03:01 AM
It comes from this OOTB Notification:
https://instanceName.service-now.com/nav_to.do?uri=sysevent_email_action.do?sys_id=9660628ed7a2220035ae23c7ce61039e%26sysparm_view=advanced
Steps to achieve
1) remove the subject from subject field
2) then update any of the existing email script and set the subject. I selected this "sla.salutation.event_parm1"
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var breachPercentage = parseInt(current.business_percentage);
gs.info('ARB breachPercentage' + breachPercentage);
var subject = "SLA " + current.sla.getDisplayValue() + " associated with " + current.task.number + "has reached " + breachPercentage + "%";
email.setSubject(subject);
var user = GlideUser.getUserByID(event.parm1);
if (user.exists())
template.print(gs.getMessage("Hello {0},", user.getDisplayName()));
else
template.print(gs.getMessage("Hello,"));
})(current, template, email, email_action, event);
Output: When I previewed the notification
The percentage 13.78% got converted to 13
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 04:25 AM
I believe I have answered your question.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 04:50 AM
Thanks for the details explination