- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2016 01:36 PM
Hello Everyone,
I wanted to ask the community how to send out notifications when a change task has been assigned to a user.
Please let me know.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2016 06:19 AM
Business rule:
Notification (Top of form and when to send):
Notification (who will receive):
Note: We don't send ours to the event creator. If you assign a change task to yourself, you probably don't need an email telling you that you did. We also decided that using an event parameter as the recipient wasn't necessary.
Notification (what it will contain):
Below is a video of this all working together to make an email when a change task is assigned to a user:
If you're still not successful after this (like if the notification still says "Record inserted or updated" instead of "Event is fired"), that sounds like an issue with the ui policies on the notification page. Try toggling between Default and Advanced view to see if that makes a difference. Otherwise, this is as far as I can help you, and you'll need to get ServiceNow support involved directly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2016 01:45 PM
There are two main ways to do this:
1. Create a notification record on the change_task table that triggers when the assigned to changes and isn't empty.
2. Create a business rule on the change_task table that triggers an event when the assigned to changes and isn't empty, and create a notification that triggers on that event.
I prefer option 2, because I unit test my events (well, I unit test the script include that I use in my business rule and also ensure the event itself fired). Option 1 is a lot easier to implement at first.
You can find a lot more detailed information here: Email Notifications - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2016 02:22 PM
Hello Justin,
I am trying the first method since it seemed like it would be the quickest solution. However, it does not seem to work. Screen Shots provided below:
I have tried setting the send when to Record inserted or updated, and fired on event.
but nothing gets sent out or logged in the event logs:
Any recommendations?
For the Business Rule, do you have an example code to query this table update to create the event log item?
Thanks in advanced.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2016 02:46 PM
Thanks for the screen shots. Very helpful, albeit somewhat confusing. If you select "Record is inserted or update", then the event name should not be present. The two are mutually exclusive. Similarly, if you select Event is fired, then insert/update disappear.
Your condition looks good. If you're not using the event method, then you are not likely to see an event triggered. Check the System Mailboxes (particularly Outbox, and Sent.) You can also try the "Preview Notification" button to run a sample test to see if/when/how it will be sent. This is useful for debugging also.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2016 03:29 PM
Hello everyone,
I am trying the following step #2 suggested from Justin:
Created the Business Rule with the following code
var myUserObject = gs.getUser();
if (gs.nil(current.assigned_to)){ //we are checking if the work_start is empty or not
gs.eventQueue("change.task.not.assigned", current, gs.work_start(), myUserObject.getDisplayName());
} else {
gs.eventQueue("change.task.assigned", current, gs.work_start(), myUserObject.getDisplayName());
}
Created an event name in the registry
Created the notification for the event item
also tried to set the "send when" to "Record inserted or updated"
and I noticed when I try to check mark "event parm 2 contains recipient" it doesnt stay saved:
When I try creating a change task, it creates the event but doesnt send an email to who the change task is assigned to:
The assigned to person has an associated email address on their sys_user table.
Any help would greatly be appreciated.