Adding users to watchlist from a catalog Request

magoo
Kilo Expert

All,

Hopefully someone knows of a simple solution!  

Ultimately what I am looking to do is add three users that are in reference fields on my request automatically onto the watch list on the RITM.  

Reason for doing this is I need to have a way to setup a notification in my workflow to send to those three users once the request is complete.   If someone knows of another solution that would allow me to add them into a notification without adding to the watchlist first I would be happy with that too, just don't see anything in the notification that would allow me to specify variables but do see watchlist as an option to send to.

The three fields I have are all reference fields on the User table,

Field Names are naCCS, naNAE, and naNAS.

Any advice/ solution would be great!

Steve

1 ACCEPTED SOLUTION

Brad Tilton
ServiceNow Employee
ServiceNow Employee

You could do this a couple of ways.



1. Use a mail script in the notification to look at the variables and add them to the recipient list.


2. Another option would be to use a Run Script workflow activity or before insert business rule that pushed the users in those variables to an array and then add that to the watch list field.


View solution in original post

3 REPLIES 3

Brad Tilton
ServiceNow Employee
ServiceNow Employee

You could do this a couple of ways.



1. Use a mail script in the notification to look at the variables and add them to the recipient list.


2. Another option would be to use a Run Script workflow activity or before insert business rule that pushed the users in those variables to an array and then add that to the watch list field.


Thanks Brad! I was going to do a mail script and after reading more found out about the Advanced "To (Script):" field. So I ended up using that.



answer = current.variables.naCCS.email + ', ' + current.variables.naNAE.email + ', ' + current.variables.naNAS.email;


johnram
ServiceNow Employee
ServiceNow Employee

The ServiceNow Wiki content is no longer supported. Updated information about this topic is located here: Scripting for Email Notifications
     
   


Visit http://docs.servicenow.com for the latest product documentation