How to create an event in run script?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 12:57 PM
How do I create an event using an script in run script? I want to be able to create an event to create a notification for each person I want to send it to.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 12:58 PM
gs.eventQueue is the method.
http://wiki.servicenow.com/index.php?title=Events_and_Email_Notification#gsc.tab=0

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 01:04 PM
gs.eventQueue("catalog.opening.dns.notification", current, xxx, xxxx);
Great! What do I need to pass in the first parameter and the second one? I didn't quite get the example on the wiki.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 01:09 PM
You can pass null, null.... that will work. Those are the parm1 and parm2 that the notification refers to when it says event recipient parm1:
I usually pass info about what record it is coming from so I can easily troubleshoot if I don't need to pass who the email is being sent to. current.sys_id, current.assigned_to, current.requested_by, or whatever.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 01:14 PM