Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 09:15 AM
@LaraReddy Instead of putting the hard coded sys_ids of users, you can query the sys_user_grmemeber table inside the record producer script and populate the watchlist as follows.
if(producer.<variable_name>=='YES'){ //Replace <variable_name> with the name of the variable you wish to check
var groupMember = new GlideRecord('sys_user_grmember');
groupMember.addQuery('group','c38f00f4530360100999ddeeff7b1298'); //Replace with the sys_id of your group
groupMember.query();
var grMemberArray = [];
while(groupMember.next()){
grMemberArray.push(groupMember.getValue('user'));
}
current.watch_list = grMemberArray.toString();
}
Please mark the answer helpful and correct if this addresses your question.