- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2020 05:17 AM
Hello,
I need to create an inbound action that auto populates the watch list with cc'd user(s) for RITMs. How can I do this? If a cc'd user does not exist in the system, I do not want to create a new user
Thanks!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2020 05:25 AM
Hi,
Within this inbound action, in the script section, you can retrieve the "copied" users (aka CC'd) which will give you a comma separated string of their email address. From there, you can query your sys_user table to find a match based off of this and if found, add them to your watch list.
Something like:
var copied = email.copied;
var watchList = current.watch_list;
var findMem = new GlideRecord('sys_user');
findMem.addQuery('email', 'IN', copied);
findMem.addQuery('sys_id', 'NOT IN', watchList);
findMem.query();
while (findMem.next()) {
current.watch_list += "," + findMem.sys_id;
}
current.update();
I just tested this myself and it does work. So as long as your inbound action has found the correct record to associate the email to, this will work just fine.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2020 10:29 AM
Well when an email is brought in, most inbound actions are set to "stop processing", so that means it'll only "run" the one inbound action. Depending on what you're trying to do, you may need to relate it to one already built and in use.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2020 12:54 PM
Hi, seems you got it all resolved.
I believe my code above would work as well as I had tested it out. This would review who is currently in your watch list, and not add them again, but only add new users who are registered in your system. A bit less code, but either way, there's many ways to get to the answer 🙂
Take care!
Please mark any other reply as Helpful, through this thread, if it was.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2020 11:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2020 12:17 PM
Figured out the issue. Had to enable inbound emails in mail properties
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2023 05:04 AM
Hi Allen,
I tired this script in my inbound email action but its not working ,
could you please help me on this
var copied = email.copied;
var watchList = current.watch_list;
var findMem = new GlideRecord('sys_user');
findMem.addQuery('email', 'IN', copied);
findMem.addQuery('sys_id', 'NOT IN', watchList);
findMem.query();
while (findMem.next()) {
current.watch_list += "," + findMem.sys_id;
}
current.update();
thanks
sid