I have to send notification prior 15 minutes to change request planned start date.

niveditakumari
Mega Sage

Hi, 

 

I have to send notification prior 15 minutes to change request planned start date. I have created attached screenshot things. 

niveditakumari_0-1707494244396.png

 

niveditakumari_1-1707494274400.png 

niveditakumari_3-1707494308647.png

 

Can you please correct that. 

 

Regards, 

Nivedita 

 

 

9 REPLIES 9

Rohini S Sane
Tera Guru

Hi @niveditakumari 

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

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 

 

 

SupriyaWaghmode
Kilo Sage

@niveditakumari 

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

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