Additional Comments Email Notifications to Contact and Watch List
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2023 11:19 AM
Hi,
I need a help in advance condition in the notification.
When a contact post additional comment then the email should trigger to Watch List user and when watch List person comment then additional comment notification should trigger to contact.
I have written a advance condition.
Email to Watch List when Public Comment:(who will receive: Watch List )
if (current.sys_updated_by == current.contact.user_name) {
answer = true;
}
else {
answer = false;
}
Email to Contact when Public Comment:(who will receive: Contact)
Watchlist is referencing to sys_user table. what will be the condition here.
Please help me.
Thanks!
Samiksha
- Labels:
-
Customer Service Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2023 02:06 AM
Please help in this, How I can compare the user table user name with the contact table user name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2023 04:07 AM
Hi @Samiksha2 ,
Hope you are doing great.
To trigger an email notification to the users on the Watch List when a contact posts an additional comment, and to notify the contact when a Watch List person comments, we can use an advanced condition in the notification setup.
- For the "Email to Watch List when Public Comment" notification, the condition can be implemented as follows:
var answer = false;
if (current.sys_updated_by == current.contact.user_name) {
answer = true;
}
2. For the "Email to Contact when Public Comment" notification, since the Watch List is referencing the sys_user table, the condition can be modified as follows:
var answer = false;
var watchListUserNames = [];
var watchListGr = new GlideRecord('sys_user');
watchListGr.addQuery('user_name', current.sys_updated_by);
watchListGr.query();
while (watchListGr.next()) {
watchListUserNames.push(watchListGr.user_name.toString());
}
if (watchListUserNames.indexOf(current.contact.user_name) > -1) {
answer = true;
}
Regards,
Riya Verma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2023 04:36 AM
Hi @Riya Verma ,
Thank you for your reply.
1st scenario is working but 2nd is not working.
When watchlist user is adding the comment notification is not triggering to Contact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2023 05:20 AM
can u please try using below condition for 2nd point :
answer = (current.watch_list_field == current.contact.sys_id);
Regards,
Riya Verma