Add UI action to add watch list on sysapproval_approver table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
user should be able to add user email in watch list through ui action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hi @suvarna sonar2,
What user should be able to do so? Because if the user doesn't have itil they will not have access to backend and thus neither to UI Actions there...
This seems a little strange to me... can you please explain the business justification behind this requirement?
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
39m ago
user want to add user in watch list , we have watcht list collector field on approval table but that filed is not editable even for admin. This OOB behaviour.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
21m ago
Can you @suvarna sonar2 please share any screenshot or context?
What you describe doesn't sound much like OOTB... and also how do you define "user"?
I checked for both CHG and KB approvals but there's no watch list available OOTB:
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2m ago
Option 1: Add Current User's Email to Watch List
UI Action Configuration:
- Name: Add to Watch List
- Table: incident (or your table)
- Action name: add_to_watchlist
- Form button: true
- Show insert: false
- Show update: true
- Client: false (server-side)
Script:
(function addToWatchList() { // Get current user's email var userEmail = gs.getUserID(); var user = new GlideRecord('sys_user'); if (user.get(userEmail)) { var email = user.email.toString(); // Get current watch list var watchList = current.watch_list.toString(); // Check if email already exists if (watchList.indexOf(email) === -1) { // Add email to watch list if (watchList) { current.watch_list = watchList + ',' + email; } else { current.watch_list = email; } current.update(); gs.addInfoMessage('You have been added to the watch list'); } else { gs.addInfoMessage('You are already in the watch list'); } } action.setRedirectURL(current); })();
Hello i hope that can help
If you find this answer useful, please mark it as solution accepted/helpful
Massimiliano Micali
