- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2018 11:07 AM
Hi!
I am working on a script that will add two users to the request watch list after a customer submits a form. One of them is a variable on the form. The other is a user.
I chose the "Run Script" activity in the workflow editor to accomplish this. When I test it, the last line is the only value that is set. My guess is that it overrides the first line of code.
//Add Approval Manager to Watch List
current.watch_list = current.variables.purchase_rqst_approval_mngr_name;
//Add User to the Watch List
current.watch_list = 'sys_id';
So how do I add both users in the workflow?
Thanks!
Cecilia
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2018 11:13 AM
You have to add them as coma separated.
current.watch_list = 'sys_id'+ ',' + current.variables.purchase_rqst_approval_mngr_name;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2018 11:13 AM
You have to add them as coma separated.
current.watch_list = 'sys_id'+ ',' + current.variables.purchase_rqst_approval_mngr_name;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2018 11:15 AM
make sure you try them separately first and see if current.watch_list='sys_id'; is working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2018 11:24 AM
That did the trick. Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2019 04:13 AM
I've been trying this but unable to do so. I'm trying to add users to the Incident record Watch List from default SLA Workflow and I'm using current.task.watch_list = current.task.assigned_to.manager.name any advice if I'm doing this correctly is appreciated. Thanks.