- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2017 07:30 AM
Hi,
I want to resend an approval for an RITM after one week of not being approved and then everyday until it is approved.
What would be the best possible way to do this.
i would like to send the original approval email that was sent with RITM request name requested_for etc.
Thanks
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2017 07:41 AM
Shay,
I may not have the cleanest way of doing it but it works for me.
Currently I have a scheduled job set to run every day that looks for approval on the approval table a week old and emails a reminder to the approver. Again, others may have more streamlined ways of doing it.
Something along these lines:
var appgr = new GlideRecord('sysapproval_approver');
appgr.addQuery('state', 'requested');
appgr.addQuery('sys_updated_on', '<', gs.daysAgoStart(7));
appgr.orderBy('approver');
appgr.query();
Then queue up your event and pass the user ID and Name through it to the notification.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2017 07:41 AM
Shay,
I may not have the cleanest way of doing it but it works for me.
Currently I have a scheduled job set to run every day that looks for approval on the approval table a week old and emails a reminder to the approver. Again, others may have more streamlined ways of doing it.
Something along these lines:
var appgr = new GlideRecord('sysapproval_approver');
appgr.addQuery('state', 'requested');
appgr.addQuery('sys_updated_on', '<', gs.daysAgoStart(7));
appgr.orderBy('approver');
appgr.query();
Then queue up your event and pass the user ID and Name through it to the notification.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2017 07:45 AM
We've created a UI action on the sysapproval_approver table
Form Button
Condition current.state == 'requested'
script:
resendApprovalEmail();
function resendApprovalEmail() {
gs.log("Sending Resend Approval Event");
gs.eventQueue("approval.resend", current, "", "");
gs.addInfoMessage("Resending approval email to: " + current.approver.email);
}
And then created a notification for approval reminders:
Table: sysapproval_approver
send when: event is fired
event name: approval.resend
who will receive: approver
Email template: we used our existing approval template
Subject 'Approval reminder - Action required ${sysapproval.sys_class_name} ${sysapproval}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2017 07:46 AM
& an Event Registration
event name: approval.resend
table: Approval [sysapproval_approver]
This thread may be helpful for creating a scheduled job:
Re: Automatically resend approval requests which are still pending
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2019 08:51 AM
Hi
I have achieved this.
I have created a button named "Remind Approval" in the approval form and scripted to fire the approval event.
Passed the approver name in Parm1.
So the Approval mail will be sent to that user only.