Add Users to Watch List When @Mentioned
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2024 02:59 PM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2024 08:10 PM
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.