How to trigger an event by Schedule Job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2022 09:53 AM
Hello guys!
I have a problem with the eventQueue, it is not triggering the notification and the event is not starting.
Schedule Job:
All conditions are being met, I did the test and everything passed (there was more "gs.info" in the code).
Event:
Do not know whether the need to put the table. But I saw another example of Schedule Job with eventQueu, which event had no table selected.
Notification > When to send:
Notification > Who will receive:
Please, if anyone can help me, I'm out of time to deliver this story!
Thank you very much!
TABLE: ast_contract
SCRIPT:
var gd = new GlideDate();
gd.addDays(-365);
var gr = new GlideRecord('ast_contract');
gr.addQuery('state', '=', 'active');
gr.addQuery('u_contract_term', '=', '2_years');
gr.query();
while (gr.next()) {
gs.info(gr.number);
var startDate = gr.starts;
gs.info("startdate" + startDate);
if (startDate == gd) {
gs.info('Entrou if startDate!');
gs.eventQueue('ipca.changed', 'gr', '');
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2022 10:07 AM
I didn't understand this "gr" as a parameter, who are you going to send it to?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2022 10:16 AM
Refer to above link which might help you understand its parameters better.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2022 10:07 AM
1. Have you checked the event log there might be your event is in queue.
2. Also please info message is printing or not ( which is the previous line of gs.eventqueue )
3. In background script just run that gs.eventqueue line and check.
4. Also check stats.do. you will find how many events are stuck.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2022 10:21 AM
I checked the event log, it doesn't have my event in the queue.
Information message is being printed.
I don't know how I can run the script in the background, can you help me?
In stats.do I did not find where it informs the events that are stopped...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2022 10:25 AM
In your code -
In gs.eventqueue you have added gr as string in parameter. It should not be string it should be gr as gliderecord.
gs.eventQueue('ipca.changed', gr,'','')