I have to send notification prior 15 minutes to change request planned start date.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2024 07:58 AM
Hi,
I have to send notification prior 15 minutes to change request planned start date. I have created attached screenshot things.
Can you please correct that.
Regards,
Nivedita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2024 08:26 AM - edited 02-10-2024 12:54 AM
You can write a business rule when plan date changes and send that date which is 15 minutes before the current.start_date as 5th parameter.
var time = new GlideTime();
time.setValue('00:15:00');
var startDate = new GlideDateTime(current.start_date);
startDate.subtract(time); // subtracted 15 minutes from start date
gs.eventQueueScheduled("<event.name>", current, gs.getUserID(), gs.getUserName(), startDate);//give your event name
Please Mark Helpful.
Regards,
Rohini Sane
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2024 12:00 AM
Hi @Rohini S Sane,
Thank you for your reply.
Above code will run only when planned start date changes then how this notification will run prior 15 minutes.
Can you please make me understand.
Regards,
Nivedita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2024 08:39 AM
In scheduled script part it looks like ,
1.Trying to fetch the change plan start date
2.adding prior to 15 mins-----please store this on variable
3. then compare with current date time
May be like this
var dgt = new GlideDateTime("start_date");
gs.print(dgt);
dgt.addSeconds(-900);
gs.print(dgt.getValue());
var now = new GlideDateTime();
var checkTime= dgt.equals(now);
if(checkTime==True)
{
trigger your event .
}
Thanks
Supriya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2024 11:47 PM
Hi @SupriyaWaghmode,
I'm testing it now. Can you please tell which time zone should I select in my profile. I'm from India.
Regards,
Nivedita