- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2016 05:59 AM
Hi,
I would like to create a scheduled job to send a reminder by notification 5 days after a task was created.
This notification must be send only one time after 5 days.
I don't find how I can do that.
Could someone help me to solve this issue, please ?
Here is my scheduled job :
send1streminder();
function send1streminder() {
var task = new GlideRecord('sc_task');
task.addQuery('short_description', 'receive draft');
task.addQuery('active', 'true');
task.addQuery('sys_created_on', '=', gs.daysAgoStart(5));
task.query();
while(task.next()){
gs.eventQueue('bg.1st.reminder', task, gs.getUserID(), gs.username());
}
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2016 06:02 AM
I'm assuming everything is working except the 'repeat check', correct?
If you want to ensure it is only sent one time, add a true/false field to your sc_task table (default=false). This script will set the value to true when it is set. Then update your script to look for only those records where the value is false (so it doesn't resend to records that are true.)
task.addQuery('u_reminder_sent', false);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2016 06:02 AM
I'm assuming everything is working except the 'repeat check', correct?
If you want to ensure it is only sent one time, add a true/false field to your sc_task table (default=false). This script will set the value to true when it is set. Then update your script to look for only those records where the value is false (so it doesn't resend to records that are true.)
task.addQuery('u_reminder_sent', false);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2023 10:32 PM
Requirement is Scheduled jobs through trigger Notifications, only create in scheduled jobs not flow designer or workflow
Like day1&3&6&10 trigger the notifications those days.
Any idea how to build the logic please let me know
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2016 06:03 AM
you can create a field like 5 days reminder in task table and update from the script and the schedule jo include the condition like 5daysreminder is false.
Thanks and regards,
Swamy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2016 12:16 AM
Hi Chuck and Swamy,
Thanks for your answer. I had the same idea but I hoped that it was possible to add a condition in my scheduled job to select only tasks created since 5 days. You can use the operators <,>,>=,<= but not = or == for a date field.