to add cc users to watchlist
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2020 11:27 PM
When end user replies to Servicenow notification the CC list should be added to Watch List in the Incident form.
I have tried a script but it is adding CC as well as To users in the watchlist. I want to add only CC list to the watchlist not the sender.
gs.include('validators');
if (current.getTableName() == "incident") {
current.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;
var wList = current.watch_list; // Existing users in watchlist if any
var rarray = email.copied.split(","); //Recipient in CC
var instanceEmail = gs.getProperty('glide.email.user'); //Email ID of your instance
for (var i = 0; i < rarray.length; i++) {
var recipient = rarray[i];
wList = (wList + "," + recipient);
}
current.watch_list = wList;
current.update();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2020 11:35 PM
email.copied | Contains a comma-separated list of email addresses in the Cc: box. |
You seem to be using the right object property. Have tried logging this property to see if the right values are present?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2020 11:49 PM
I am using email.copied itself but in watchlist it is showing me cc list as well as sender name. I only want cc list not sender name.