When you put @mentions in Additional Comments It adds that user to Watch List

Kevin M1
Kilo Contributor

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

1 ACCEPTED SOLUTION

Mark Roethof
Tera Patron
Tera Patron

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.

find_real_file.png

find_real_file.png

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

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

8 REPLIES 8

Mark Roethof
Tera Patron
Tera Patron

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.

find_real_file.png

find_real_file.png

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

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

I really appreciate you knocking this out so quickly. I created the Business Rule but does not seem to be working for me. Was not sure if I was doing something incorrectly. When I added the @System Administrator it did not add them to the Watch List once I refreshed the page. 

 

find_real_file.png

Hi there,

Does this work if you mention a different user - with email adress and notifications on? If you are logged in as sys admin, and do a @mention on yourself... no @mention email etc is created. You just cant mention yourself 🙂
So also not the watchlist in this case.

If this still not works, can you share the business rule you setup? Can you also verify that records are written into the live_notification table?

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Hey, I am currently Logged in as me (Kevin Maiberger) and have tested with multiple users that I work with and nothing. Notifications are on.

 

find_real_file.pngfind_real_file.png

find_real_file.png

 

I did tag David Akers but notification not showing it was sent to him but it does show that Amanda Sanchez Notification went out due to her having the ticket assigned to her.