Events are getting fired but Notifications are not getting triggered through Schedule Job.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2023 08:38 AM - edited 07-30-2023 08:39 AM
I am trying to trigger a notification when an Event is fired through Schedule Job.
Schedule Job - I selected "Automatically run a script of your choosing" as attached.
Script -
var ownerInactive = new GlideRecord('sn_grc_profile');
ownerInactive.addEncodedQuery('owned_by.active=false');
ownerInactive.query();
while(ownerInactive.next()){
gs.eventQueue("sn_grc.entity.owned.by.inactive", ownerInactive, "", "");
}
Event - sn_grc.entity.owned.by.inactive on Table - sn_grc_profile
Notification - Table - sn_grc_profile
When to send - Event is fired
Who will receive - A group
I don't know why notification is not getting triggered with the above configurations. Can someone pls help me on this?
I am stuck on this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2023 02:05 AM
@aagman4 How will you define newly inactivated users in Scheduled job script, for a scheduled job either a user is active or inactive. Unless you store the newly inactivated user on some custom table and remove them from there once the notification is sent to them, there is no way for the script to figure this out.
Instead of triggering this notification from a scheduled job, I recommend triggering it from an onAfter Update business rule with conditions Active changes to False. From the business rule script you can trigger your event and it will be sent to the user who recently become inactive within the system.
Hope this helps.