Custom notification query
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi,
We have auto reject enabled on catalogue approval models. The approver receives reminder emails are intervals advising 'This is a reminder that you have a pending approval for the following request.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Have you tried a mail script that uses something like this?
var gdt1 = new GlideDateTime(); //Now
var gdt2 = new GlideDateTime("<expiration_date>");
var dur = GlideDateTime.subtract(gdt1, gdt2);
template.print(dur.getNumericValue() / (1000 * 60 * 60 * 24)); //Convert milliseconds to days, add Math.floor(<formula>) or Math.ceil(<formula>) to round down or up if needed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @cw82uk ,
Yes, this can be handled through an Email Script in the approval reminder notification.
Calculate the remaining days based on the auto-rejection date and display it dynamically:
var rejectDate = new GlideDateTime(current.auto_reject_date);
var now = new GlideDateTime();
var diff = GlideDateTime.subtract(now, rejectDate);
var days = Math.ceil(diff.getNumericValue() / 86400000);
template.print('Please note that this request will get auto-rejected in ' + days + ' days.');Add the mail script to the reminder notification:
${mail_script:Auto Reject Countdown}If the auto-rejection date is not stored on the approval record OOB, calculate it using the configured auto-rejection interval.
Mark this as Helpful if it clarifies the issue.
Accept the solution if this answers your question.
Regards,
Vaishnavi
Technical Consultant
