Issue firing Events/Notifications based on the Task table from Workflow/Business Rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2020 09:29 PM
Hi all,
I have a requirement to send a OOB Task level Notification for an external (user outside of servicenow) email id, I have created a branch activity and kept catalog task as well as Run script in workflow to handle in parallel , so first as soon as task gets created the run script to call the event "sc_task.assigned.to.group" and sends notification to "abc@gmail.com".
But only the event log is created, email is not sent for the above. I even tried to trigger event by creating "Create Event" in workflow but this is also just creating a event log , email is not sent.
So I tried the same even with Business rule, but still only the event log is created email is not sent or ignored.
Note: I checked even the event parameters in the corresponding notification and tried, then too not working.
Any assistance would be greatly appreciated.
Thanks
Lavanya
- Labels:
-
Request Management
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2020 09:33 PM
Hello ,
Have you enabled email properties? or you can check condition in BR.
please check this,
Thanks,
Pratiksha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2020 09:40 PM
Sorry, forget to add the below line,
I need to send this email to external user only for one catalog item and only for one task in that item, not for all or everytime.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2020 09:47 PM
Hi
The "Create Event" Activity in Workflow will not work, as it creates a "Workflow Event", which is different to the system event you need for triggering your Notification.
1. Using a "Run Script" with:
gs.eventQueue('youreventname', current, '', '');
where "youreventname" ist the Event you want to fire, will work fine to create the event.
2. Having the Event fired, you need to make sure, that your Notification will trigger on that:
You need to trigger on the "Event is fired" (for the "Send when" field) and use EXACTLY the same Event, that you used in the "gs.eventQueue()" function call from above. That way, your notification will trigger.
You can see if your Email was generated by having a look to the "Outbox" or "Sent" mails.
If that does not work for you, let me know, where you got stuck. We will figure out.
For some additional reading for you, just go to this link:
Let me know if that answers your question and mark my answer as correct and helpful, please.
BR
Dirk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2020 11:00 PM
Hi,
Thank you for your reply, below is the code I used in Business rule for triggering. Created BR on RITM table so I used Glide Record. Before this I tried directly for Task table itself , whatever I am changing workflow run script or BR. I am getting only in event log, nothing triggering in Outbox or emails log for this.
BR: Table : Requested Item
When to : Display
var tsk = new GlideRecord('sc_task');
tsk.addQuery('request_item', current.getValue('sys_id'));
tsk.addEncodedQuery("short_description=Task 1^state=1");
tsk.query();
if (tsk.next()) {
gs.log("calling event sc_task.assigned.to.group .......");
gs.eventQueue('sc_task.assigned.to.group', tsk,tsk.sys_id,'abc@gmail.com');
}