- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2016 05:03 AM
Hi everyone,
I have to create an email notification based on the Incident table with the following conditions:
- if the existing Assigned to person from the same support group changes then an email needs to be firing and send a notification to the previous Assigned to telling him that he is no longer the Assigned to person on that incident
So if X from the Smart Support Assignment group for example is the current Assigned to person and Y from the same support group is replacing X with him and assigns himself on the incident as he Assigned to person then an email needs to be sent to X telling him that he is no longer the Assigned to person for that incident.
I have tried to get this done through an email notification but I don't see anywhere in the "Who will receive" tab a option to specify that the email needs to be sent to the previous Assigned to person.
Does anybody know how to accomplish this?
Thank you,
Bogdan
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2016 07:00 PM
Hi Bogdan,
I believe the solution for you is in two parts: 1) create an event for yourself by Business Rule, and 2) create a Notification that fires on the new event.
You can reference the previous values of a record within a before/after business rule, but I don't think you can reference previous from within the script on a Notification itself. So you'll have to do the BR to capture your info and the Notification to respond to it.
Here is how I'd approach this solution:
- For your Business Rule:
- check the Advanced box
- in the condition field, enter:
current.assigned_to.changes() && (current.assigned_to.u_default_group.sys_id == previous.assigned_to.u_default_group.sys_id) - for When to Run, select "After" and "Update"
- in the script, enter:
function onAfter(current, previous) {
//This function will be automatically called when this rule is processed.
gs.eventQueue("incident.reassigned", current, current.assigned_to.sys_id , previous.assigned_to.sys_id);
} - Register your new event (Event Registry - ServiceNow Wiki) as "incident.reassigned"
- For your Notification:
- Choose Send when: "Event is fired"
- On "When to send", Select your new event as the Event name
- On "Who will receive", Select the "Event parm 2 contains recipient" checkbox
- Fill out the rest of your notification as normal to let the person know they no longer have the ticket.
Good luck,
-Brian
Edit: What Ravi said... but with more words.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2016 06:13 AM
Maybe you could create a new field on the inc table that stores the previous 'Assigned To' user, have it get updated through a business rule whenever the 'Assigned To' changes. This would give you a filed to use for the e-mail notification.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2016 08:15 AM
You can trigger an event when it happens and put the "old assignee" as value when you create it, then you can trigger a notification with that.
Let me know if you get stuck.
//Göran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2016 08:20 AM
Pass old assignee as a parameter using business rule while triggering the event.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2016 07:00 PM
Hi Bogdan,
I believe the solution for you is in two parts: 1) create an event for yourself by Business Rule, and 2) create a Notification that fires on the new event.
You can reference the previous values of a record within a before/after business rule, but I don't think you can reference previous from within the script on a Notification itself. So you'll have to do the BR to capture your info and the Notification to respond to it.
Here is how I'd approach this solution:
- For your Business Rule:
- check the Advanced box
- in the condition field, enter:
current.assigned_to.changes() && (current.assigned_to.u_default_group.sys_id == previous.assigned_to.u_default_group.sys_id) - for When to Run, select "After" and "Update"
- in the script, enter:
function onAfter(current, previous) {
//This function will be automatically called when this rule is processed.
gs.eventQueue("incident.reassigned", current, current.assigned_to.sys_id , previous.assigned_to.sys_id);
} - Register your new event (Event Registry - ServiceNow Wiki) as "incident.reassigned"
- For your Notification:
- Choose Send when: "Event is fired"
- On "When to send", Select your new event as the Event name
- On "Who will receive", Select the "Event parm 2 contains recipient" checkbox
- Fill out the rest of your notification as normal to let the person know they no longer have the ticket.
Good luck,
-Brian
Edit: What Ravi said... but with more words.