We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Additional Comments Email Notifications to Contact and Watch List

Samiksha2
Mega Sage

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

5 REPLIES 5

Hi @Riya Verma ,

Still not working.

 

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;
answer = (current.watch_list == current.contact.sys_id);
}