Add Users to Watch List When @Mentioned

tiguin2798
Tera Guru

Team,

I have a requirement where we need to add users to the watch list when @mentioned on incidents, changes, and catalog items. I have attempted with the two following scripts on the 'live_notifications' table, but users are still not being added to the watch list. Can you please advise if there is an error in my code or a better way to achieve this?

tiguin2798_0-1713823157306.png

 

 

 

tiguin2798_1-1713823177872.png

 

 

1 REPLY 1

Community Alums
Not applicable

Hi @tiguin2798 ,

That's actually a bit confusing thing to do.
live_mention table holds the mentions, but I'm pretty sure it doesn't have any direct connection to as where the mention was done. The sys_journal_field table also shows a @ and user's name, but there's nothing that actually indicates it's a mention, so you can't just grab it from there easily. Especially since a user can be named "FirstName SecondName ThirdName LastName" so you can't be sure when the name ends.

Try creating a before update BR that logs comments.
Then write a comment where you tag someone.
Check the log to see if it shows @[user_sys_id] at that point, so that you can then add the user to watch_list.