Trigger an event using background script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2022 01:45 AM
Hi,
I am having one requirement to build a notification to notify a group when the record is inserted in 'quarantine_file'. To test this notification, I need to create an event and then trigger the notification with the event.
But I haven't worked on event before. So kindly help me to trigger the event through background script so that I could test the notification as we cannot directly create a record in 'quarantile_file'.
Thanks in Advance!!
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2024 03:46 AM
You can use the following code to call an event in server side script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 07:51 PM
Hi @PriyaRaj,
1. Create event in the "Event Registry'.
2. In the background script write below code to trigger the event
var grTask = new GlideRecord('task'); //glide into your table
grTask.addQuey('___'); // add your condition
grTask.query();
while(grTask.next()) { //if any record found then send notification
gs.eventQueue('Event_name',grTask,parm1,parm2); // trigger event using eventQueue() method
}