Event Queue-Trigger Notification From Business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2022 07:44 AM
Hi,
Can someone help me with how to trigger Notification from Business rule. I want to trigger notification to assiged_to on ScTASK.
This is the script that i have added:
var gr1 = new GlideRecord('sc_task');
gr1.addEncodedQuery('active=true^stateIN-5,1,2^request_item.requested_for=' + current.sys_id);
gr1.query();
while (gr1.next()) {
//gs.log("Records count" + gr1.getRowCount() + gr1.number);
gr1.comments.setJournalEntry('Requesting fulfiller to Close-Incomplete the task as requestor is no longer part of organisation.', 'admin');
gr1.update();
gs.eventQueue('notify_email_to_fulfiller',current,gr1.assigned_to);
}
This is not working!
please help me with the event and how to add that on BR
Thanks in advance.
Regards,
Nikitha
- Labels:
-
Notifications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2022 07:46 AM
"Not working" in what way. Is the event actually firing?
If so, do you have a notification configured to trigger off that event?
- If so, do you have any further conditions on the notification that may prevent successful send?
-- If not, are you testing with your own email address and have "send to event creator" unchecked?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2022 07:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2022 07:55 AM
Hi, Can you check the eventQueue syntax in your code and check event logs.
gs.eventQueue("incident.commented", current, gs.getUserID(), gs.getUserName());
Can you check the notification template as correct event name configured and check the event parameter enabled.
Name | Type | Description |
---|---|---|
name | String | Name of the event being queued. |
glideRecord | Object | GlideRecord object, such as "current". |
parm1 | String | (Optional) Saved with the instance if specified. |
parm2 | String | (Optional) Saved with the instance if specified. |
queue | String | Name of the queue. |
This screenshot part of notification template comes under 'Who will Receive' tab.
Please mark as correct answer if it helped.
Regards,
Suresh.
Suresh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2022 08:14 AM
Hi,
You have an other option to troubleshoot.
gs.eventQueue('notify_email_to_fulfiller',current,gr1.assigned_to); Keep this code only in business rule and comment other codes. Remove your filter condition in business rule and you should check only 'update' action.
Once done - try to update the maually then check the event logs and emails. If not triggered you should fix the above one line code and notification template.
Please mark as correct answer if it helped.
Regards,
Suresh.
Suresh.