RITM Approval Email reminder.

Inactive_Us2432
Kilo Contributor

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

1 ACCEPTED SOLUTION

Brandon Smith3
Kilo Expert

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.


View solution in original post

4 REPLIES 4

Brandon Smith3
Kilo Expert

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.


Cheyenne1
Kilo Guru

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}


& 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


avidev
Tera Contributor

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.