- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2017 09:43 AM
Hello Team
I have an issue related to email notification. We have a reference field in one of our catalog item. I'm trying to add this field in the 'Who will receive' tab in the notification,
but couldn't find the way. The point here is, upon resolution of the RITM, this notification should be triggered to the user's ( who is in the reference field ) manager.
Any idea on how to add this users ( scott hatch ) manager to be added in the 'users/group in field' list ?
Regards!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2017 08:24 PM
Hi Nitin,
If you noticed, I have declared a variable named 'recipient' in my last response. I'm passing that variable inside gs.eventQueue() function. The syntax of object.eventQueue() can be understood from the section 3.1 of this link GlideSystem - ServiceNow Wiki . If you are trying to send the email to the person who is selected in the reference field in the variable then you must define the variable as var recipient = current.variables.variable_name; If you are trying to send the email to the manager of the selected person then it would be like var recipient = current.variables.variable_name.manager; Reference field always passes the sys_id of any user, so you do not have to write recipient.name.
For your 2nd question, the answer will be YES. But you must remember the logic of call the same event must be different and same a single notification should be defined. Otherwise, whenever you are calling the same event from multiple business rules for multiple logic, the same notification will get triggered (considering the notification is selected as Event is fired with the same event).
Please try again now and let me know if you face any problem.
I hope this helps.Please mark correct/helpful based on impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2017 10:04 AM
Hi Nitin,
You should trigger this notification through an event called from a business rule on the requested item table when the item is completed. The event parm 1 should contain the user sys_id which should be current.variables.variable_name where variable_name is the reference field name.
On the notification, you should select this event and also event parm1 contain recipient checkbox. The event should be called from the business rule as
gs.eventQueue('event_name', current, current.variables.variable_name, '');
Thanks
Please Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2017 10:15 AM
Also cant you send this notification from the workflow activity?
The notification activity script allows you to push the user as an email recipient.
Thanks
Please Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2017 10:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2017 12:30 PM
Hi veena, thanks for your reply. I agree with your solution, but it works for system reference fields like Requested for, Assigned to etc, But this is a custom field on our form which we created with type 'Reference' I'm trying to pull this field in the Available list
How can i populate this ?
Regards!