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 12:38 AM
At the top. This needs to be done first, before the other code is executed, because otherwise you won't have the users in the watchlist. They need to be set and saved and then will be shown as recommended.
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-08-2025 01:17 AM
Hello Mark,
I have added the code at top itself so that first the assignees get mapped into watchlist and then UI action code is executed. But this not working at the moment.
Could you please be more specific and let me know where should I add the code, it will really be helpful.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2025 01:44 AM
the users should be present in the watch list in the database even before the UI action executes.
You cannot add the users in the watch list when UI action is clicked and then expect the UI action to pick the correct watch list users.
When you click the button by that time the new users are not added yet on CHG.
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-08-2025 01:07 AM
either you will have to copy the users from changes tasks to CHG so that the OOTB MS Teams chat UI action picks those
OR
check this link if it helps, also you will have to see the OOTB code and logic if you can include additional users when the button is clicked
Start MS Teams Chat (UI action) Recommended User list configuration
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