Exception Reports should also Include Exception Age
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2025 09:47 PM
Hi Team,
I have one requirement on Customer Service Application,
In that i have Exception Table, and we have Exception Reports as well, and now i want to show the age of those Exceptions,
For that i have created one Custom field, i.e, Exception Age (String field), and in the field dictionary calculate section i have written the below script.
Thanks,
Priya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2025 10:02 PM
share how did you configure it and where you wrote this script, share screenshots
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-22-2025 10:29 PM
I'm not sure how you configured that on your end, but I've tried the script below in my PDI, and it's working as expected. Please find it below.
(function calculatedFieldValue(current) {
// Add your code here
var created = new GlideDateTime(current.getValue('sys_created_on'));
var today = new GlideDateTime();
var dur = GlideDateTime.subtract(created, today);
return dur.getDisplayValue();
})(current);
Output:
Regards,
Siva