How to send notification exactly before 7 days only
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2018 09:25 AM
Hi ,
Here Request is : i have one field First review date: 25-May-2018
now i would like to send notification exactly 7 days before from First Review Date of records.
Problem is as per my script it is trigger which records are having 25th, 26th,24,23,22 dates, dates of records are also triggred.
Schedule Jobs
var apprvog= new GlideRecord('change_request');
apprvog.addEncodedQuery('active=true^u_first_review_dateRELATIVEGE@dayofweek@ahead@7');
apprvog.query();
while(apprvog.next())
{
gs.eventQueue("first_review_date" ,apprvog, apprvog.assigned_to);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2018 09:51 AM
Hi Chanikya,
you can use the below script.
var apprvog= new GlideRecord('change_request');
apprvog.addQuery('active', true) ;
approvog.addQuery('u_first_review_date', '<=', gs.daysAgo(-7));
apprvog.query();
while(apprvog.next())
{
gs.eventQueue("first_review_date" ,apprvog, apprvog.assigned_to);
}
Thanks,
Jag.
Please mark CORRECT/HELPFUL as needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2018 10:10 AM
Hi,
Not working......
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2024 01:12 PM
Hi,
I was having the same kind of issue, in my case I needed to send a reminder after exactly 7 days of creation if the state was pending but it was giving me the results of all tasks created before 7days even on the 8th day, 10th day and ones created a month ago. So the query that I am using is
You can try this, As RELATIVEGT@dayofweek@ago@8 is fetching all 8-day records and RELATIVELT@dayofweek@ago@7 is removing 1st 7 days from those. You can use days according to your requirements.
I hope it will help. Thumbs up if it's helpful.
Thank you,