Triggering event from script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2015 04:25 AM
Hi All,
Can we trigger event from script include as follows:
gs.eventQueue("sla.user.triggerEmail",);
Actually I have written one function in script include which contains gs.eventQueue(); , this function is called to trigger the event which results in triggering email notification.
Is it valid to use gs.eventQueue() in script include?
- Labels:
-
Integrations
- 22,972 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2015 05:01 AM
I think you have to pass the parameters for it to work.
Events and Email Notification - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2015 05:08 AM
Mike Allen I don't want to pass any parameter, just want to trigger event, rest of the things will be done by notification which will triggered based on event.
Harish Murikinati I not making glide query in the function, so how can i pass glide object, any other alternative.
with gs.eventQueue("sla.user.triggerEmail"); I am not able to get the event in logs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2015 05:12 AM
Then maybe you can do:
gs.eventQueue("sla.user.triggerEmail", current, null, null);
or something like that?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2019 12:44 PM
Create script include in global, make it accessible form all scopes:
var myGlobalFunctions = Class.create();
myGlobalFunctions .prototype = {
initialize: function() {
},
globalEventQueue: function(event,gr,param1,param2){
gs.eventQueue(event,gr,param1,param2);
},
type: 'myGlobalFunctions '
};
Then you can call it from your scope like this:
new global.myGlobalFunctions().globalEventQueue("myevent",my_gr,myParam1,myParam2);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2015 05:16 AM
if your not passing parameters means who will receive the email ? Are you hard coding the email?