Auto populate watchlist through UI action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2025 11:01 AM
Hello,
I have requirement that whenever 'Start Microsoft Teams Chat' UI action is clicked on Change form, all the assignees of the associated change tasks should be part of Recommended in the chat that is about to open. As of now, in OOB functionality only that particular Change's assignment group member appear in the Recommended.
Now, I found that all the members of watchlist too appear automatically in Recommended.
I would require help in how to add users automatically when the 'Start Microsoft Teams Chat' is clicked.
As an alternative, I have written a client script which maps Change Task assignees whenever they are changed but the best solution would be if I could have the assignees when the button is clicked.
I tried writing in the client script of UI action but it does seem to work.
UI Action : Start Microsoft Teams Chat
function onClick(g_form) {
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2025 10:53 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2025 08:44 AM
Hello Ankur,
Thank you for the response!
I am handling it through 'OnChange' client script to populate/remove the assignees from watchlist of change and its working fine.
Just need one suggestion, suppose I have 25 CTask open in a change and 10 are assigned to same Assignee. Now, instead of adding the assignee 10 times in watchlist, I am checking if the sys_id of user already exists then it should not add again in watchlist but the issue is if this assignee is removed from any of the 10 CTAsks then he will be altogether get removed from the watchlist.
Can you suggest what would be the best solution here, should I have the assignee added 10 times in watchlist or is there any solution which can be implied.
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2025 02:50 AM
On adding/removing an assignee, you should do an update to the watchlist (look up all tasks and set the new watchlist with all users just in there once). That way the new assignee gets added and the one removed only gets removed if he is no longer assigned to any task.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2025 03:14 AM
since 10 Ctask can be assigned to same person, you need to populate that only 1 time in watch list as it's the same user (same sysId).
Ideally if you remove that assignee even from 1 task you need to check if this user is still an assignee on at least 1 task, if yes then keep that person. If not then remove it from watch list.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader