- 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-17-2016 01:28 PM
Hi Brian,
This is an interesting thread which kicked off with a interesting question.
I was wondering however about the u_default_group in the condition field you refer to.
Am I missing something or is this unexplained?
Best Regards
Tony

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2016 02:10 PM
Hi Tony,
It's a mystery...
No, that is a custom field we've added to [sys_user] for various uses (automatic assignments by category, notifications, etc.). I hadn't thought about that in my earlier post... A regular Joe (such as yourself) would need to adjust that condition to something like:
current.assigned_to.changes() && (current.assignment_group.sys_id == previous.assignment_group.sys_id)
The rest of that solution should play out the same, though.
Good catch.
-Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2016 03:12 AM
Hi Brian,
Thank you for taking the time to detail the solution, it worked perfectly.
Thanks,
Bogdan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2016 11:46 AM
Glad to hear it.
-Brian