How to Use gs.eventqueue?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2022 05:23 AM
Through inbound email actions iam Creating a New Case form, if the mail domain is from gmail, case should not be created and a notification should be sent to the Sender's mail how to do this?
i have used gs.event queue but the notificantion is not sending
current.u_insp_email = email.from;
var domain = email.from.split('@')[1];
gs.info("Name is: " + domain);
if(domain=='gmail.com')
{
current.setAbortAction(true);
gs.eventQueue('sn_customerservice.Found', current , email.from.toString());
}
case is not creating , but the eventqueue is not working
how to do that?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2022 05:35 AM
Hi @servicenow lath
1) Checkout this video by Chuck for a tuturial of gs.eventQueue() - https://www.youtube.com/watch?v=jXkGt4iJsnY
2) Also, find developer documentation here for the same - https://developer.servicenow.com/dev.do#!/learn/learning-plans/quebec/new_to_servicenow/app_store_le...
.
BR.
Ishaan Shoor

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2022 05:38 AM
There are two ways to generate events:
- Server-side script
- Workflow Create Event activity
Server-side Script
The eventQueue() and eventQueueScheduled() methods are part of the GlideSystem server-side API. Use the eventQueue() and eventQueueScheduled() methods to generate events in server-side scripts.
The eventQueue() method inserts an event in an event queue. The eventQueue() method is typically passed four parameters but can also take an optional 5th parameter:
- Event name. Enclose the event name in quotes.
- GlideRecord object, typically current but can be any GlideRecord object from the event's table.
- Any value that resolves to a string. This is known as parm1 (Parameter 1). Can be a string, variable that resolves to a string, or method that resolves to a string.
- Any value that resolves to a string. This is known as parm2 (Parameter 2). Can be a string, variable that resolves to a string, or method that resolves to a string.
- (Optional) Name of the queue to manage the event.
example:
gs.eventQueue('x_60157_employee_spe.employeeOccasion',current,current.number,gs.getUserName());
BR.
Ishaan Shoor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2022 05:36 AM
Hi @servicenow lath ,
Please refer below threads as well:-
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2022 06:08 AM
Without using GS.eventqueu how can we send notification.
due to certain conditions the case record is not created by inbound actions,
and i need the notification to be send to the user "case is not created"