- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2019 09:00 PM
I am looking to have it when you put @mentions in additional comments it will take check that users sys_id and add them to the Watch List which would display their Name. If the user is already added to the Watch List I would not want them to be added a 2nd time. I believe this can be completed through a Business Rule but not really sure where to start.
If anyone could assist me with this I would be greatly appreciated.
Kevin Maiberger
Kevin.Maiberger@transplace.com
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2019 12:27 AM
Hi there,
Curious about this one, I give it a go myself. Ending up with a working business rule! Only part: you don't instantly see the watch list updated, only on refresh 😞 Though the users are added, and added only once.
var grTable = new GlideRecord(current.table);
grTable.get(current.document);
if(grTable.watch_list.indexOf(current.user) == -1) {
grTable.watch_list += ',' + current.user;
grTable.update();
}
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2019 10:39 AM
Maybe I found the error... I tested with values in the watch list. Not with an empty watch list.
Added || !grTable.watch_list to the if statement, now works.
var grTable = new GlideRecord(current.table);
grTable.get(current.document);
if(grTable.watch_list.indexOf(current.user) == -1 || !grTable.watch_list) {
grTable.watch_list += ',' + current.user;
grTable.update();
}
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2019 10:51 AM
That is working for me for Single @mentions but if I have 2 then its only adding 1 of the users I have @mentions
In the screenshot below I have @Xavier Abaunza & @David Akers
- Its showing both have been added to Watch List in comments but not actually displaying both in Watch List.
Outside of this small issue its working great.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2019 11:10 AM
Hmmm nice finding. I changed the Business Rule to after, instead of async. And tested with adding 1, 2, 3 @mentions, seems to work.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2019 11:19 AM
Thank you so much!!! That is working perfectly.
I have Marked as Correct Answer.
Again thank you so much for your work on this!
Kevin Maiberger