How to use 2 eventQueueSchedule() method for different condition(before 24hrs and 2hrs) in one 1 BR?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 12:36 PM - edited 08-07-2024 12:40 PM
Hello
Could you please help me with this notification trigger using eventQueueSchedule() method.
I have received a requirement related to push notifications generation before the 24 hours and 2 hours of windows start field on work order task. For this we've created a business rule on insert and on update. In this we are successfully able to display the notification for 24 hour before as per the condition. But for 2 hours event it display both notification 24 hrs and 2 hrs. The 24 hrs notification displays before some time of 2 hrs. I will provide the BR script below:
BR script:
var winStart1 = current.window_start ;
var gdt1 = new GlideDateTime(winStart1);
gdt1.addSeconds(-86400);
gs.eventQueueScheduled ("24.Hour.Push.Notification" , current , gs.getUserID(), gs.getUserName(), gdt1);
var winStart2 = current.window_start ;
var gdt2 = new GlideDateTime(winStart2);
gdt2.addSeconds(-7200);
gs.eventQueueScheduled ("2.Hour.Push.Notification" , current , gs.getUserID(), gs.getUserName(), gdt2);
Your help will be much appreciated as this requirement wants to be done on urgent basis.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2024 04:32 AM - edited 08-09-2024 04:34 AM
Hello
Answer to my question if some one needed:
1) Create a push notification.(do not forget to register it in Push application )
2)Create two events in Event Registry
4.) Create a Business Rule on after update and insert.
add condition if specific(my case windows star) field changes.
5) Below is the updated script for BR:
Do it. It will work smoothly.
Thanks and Regards
Aakanksha Lavande