Send Approver notification if created more then 3 days
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2016 08:03 AM
Hi guys,
We are doing some work around sending approval notification reminders and we have a solution implemented whereby they are sent out every 3 days.
However, we want to also add a condition that reminder is not sent unless the approval is more than 3 days old. Is this possible?
So this is where we are at so far:
- Created new event:
- Created notification to send when even is fired.
- Created a schedule o run periodically every 3 days with the following script:
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('state', 'requested');
gr.addQuery('sysapproval.sys_class_name','sc_request');
gr.query();
while (gr.next()) {
gs.eventQueue("approval.reminder",gr, gs.getUserID(), gs.userName());
}
This is how the schedule looks:
Has anyone achieved it so that reminder is not sent unless the approval is more than 3 days old? Field is called 'sys_created_on'.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2016 08:39 AM
Hi Gerard,
When I'm looking to add queries based on dates, I usually use encoded queries since it's really easy to generate them from a list.
Then you can just add this line to your existing query:
gr.addEncodedQuery('sys_created_onRELATIVELE@hour@ago@72');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2016 08:51 AM
Hi Gerard, We can achieve this by using a workflow. we had a requirement in which we have to generate a reminder email after 5 days.
Find the below steps
1)Create a property in which you define the value 72.
2)In workflow you can add like that - var time = gs.getProperty('property name'); time = time * 3600; answer = time; // it will give you time lag of three days
3) After that you can check your conditions if satisfy, trigger notification and point to the timer again.
Thanks Varun Monga
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2016 09:03 AM
Will the Created <=javascript:gs.hoursAgo(72) get the time 3 Days ago from now or time of 3 Days after the created date?
What we want is to not email the reminder when the approval is less than 3 days old.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2016 10:01 AM
Hi Gerard,
It would get the time three days ago from now, then not send the reminder if it was less than three days ago.