- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2022 01:39 PM
I need to auto populate the watchlist with the assignment group that have been selected on an incident form and it change in real time. so if it in hard the watchlist will have all the group member, when it in software, the watchlist should be change to the software group member, when it blank the watchlist should also be blank. How do i get a group on the watchlist when you can only pick on the user table?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2022 01:12 AM
Hi @edwardwong ,
In that case use below client script and script include:-
Client Script Onchange of assignment group:-
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Populate Support group from Service Offering
g_form.setValue('watch_list','');
var assignmentGroup = new GlideAjax('getUsersWatchList'); //test is script include
assignmentGroup.addParam('sysparm_name', 'getWatchList');
assignmentGroup.addParam('sysparm_group', newValue);
assignmentGroup.getXML(setWatchList);
function setWatchList(response) {
var group = response.responseXML.documentElement.getAttribute('answer');
g_form.setValue('watch_list',group);
}
}
Script include Client Callable :-
var getUsersWatchList = Class.create();
getUsersWatchList.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getWatchList: function() {
var grArr = [];
var assignmentGroup = this.getParameter('sysparm_group');
var grpMembers = new GlideRecord("sys_user_grmember");
grpMembers.addQuery("group", assignmentGroup);
grpMembers.query();
while (grpMembers.next()) {
grArr.push(grpMembers.getValue('user'));
}
return grArr.toString();
},
type: 'getUsersWatchList'
});
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2022 06:58 AM
I trying to see why it not working and, i been getting this [PA AppSec] Daily Data Collection completed with error. Why is this happening?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2023 05:47 AM
member name not seen in watchlist on sys_id of member get
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2023 05:52 AM
only reflect sys_id of user i want name of that user how can achive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2022 03:38 PM
Hi, can you clarify the business requirement\driver for this?
Why must member of the task assignment group be visible in the watch list?
Watchlist members would not normally get updates to task work_notes,
and assignment group members would normally receive notifications based on notification 'Users/groups in fields'
like these OOB examples
/sysevent_email_action_list.do?sysparm_query=active%3Dtrue%5Erecipient_fields%3Dassignment_group&sysparm_view=
This seems like an unnecessary customization, what are you trying to achieve?
You would also have issues removing users if the assignment group changed, as there is no OOB way to identify if a group member pre-existed in the watch list before it was updated with the current assignment group members.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2022 06:57 AM
You can add users from group to watchlist.
You have to extract users from group and add into watchlist.
You cannot set watchlist value as group and it will take all users automatically