Include Watch list on SC_Task email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2023 11:14 AM
Hello, I would like to include users that are added on watchlist to email cc column. I created an email script but I'm not seeing the users in the cc column when i try to send an email.
if(!current.watch_list.nil()){
//get watch list addresses and add to cc
var watcherIds = current.watch_list.split(",");
//get user records
var user = new GlideRecord("sys_user");
user.addQuery("sys_id", watcherIds);
user.addQuery("notification",2);
user.addQuery("email","!=","");
user.query();
while(user.next()){
//add to cc list
email.addAddress("cc", user.email, user.getDisplayValue());
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 01:25 AM