Create sys event for notifications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2022 11:27 PM - edited 11-22-2022 11:28 PM
Hey
I am working on making a notification being sent on a specific time.
I have created a field "u_end_user_follow_up" which automatically populates the field with Date/Time 5 days after a task is set to "Pending".
I was then looking at this https://www.servicenow.com/community/it-service-management-forum/how-to-send-notification-when-due-d...
I was attempting to make a business rule to send a notification, but the thread above is saying "create an event"
And I get that, an event needs to happen that the BR monitors in order to know when to fire.
But she doesn't state what to put in the event except the name, and I don't expect an empty event to be enough.
Can you help me figure out what to put in this event for it to trigger with my field reaches its time?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2022 11:45 PM
You can create a scheduled event:
gs.eventQueueScheduled(Event name, Object instance, String parm1, String parm2, Object expiration)
Object expiration should have the time when the event needs to be processed.
Regards,
Rana
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 12:34 AM
Hey
Thank you for the answer, this sadly didn't get me closer to a solution as I need to have the answer dumbed down more.
I get the idea of making the scheduled event, but what type of information needs to be put into the scheduled event?
The script you wrote seems to be the business rule script,
1. What information needs to be in the Scheduled event in order to create an event from when the field date is reached in the u_end_user_follow_up field?
In the business rule, the script should look something like:
gs.eventQueueScheduled(Name_Of_Scheduled_Job_Event,current,gs.getUserID(),gs.getUserName(),current.u_end_user_follow_up)
2. Does above script look true
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 01:54 AM
Your script looks fine. parm1 and parm2 can have the recepients or some other value if you plan to create an email script, else you can just add "" if you are not using one.
Regards,
Rana
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 04:52 AM
Cheers. Now what data do I need to enter into the Scheduled event in order for the BR to run?