Create sys event for notifications

Jesper Domino A
Tera Expert

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?

4 REPLIES 4

Rana5
Tera Expert

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

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

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

Cheers. Now what data do I need to enter into the Scheduled event in order for the BR to run?