Fix script to add 3 user in a field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2025 05:58 PM
Need a fix script to add 3 users in Co-managers field in a group

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2025 06:05 PM
Hi Deo,
Can you provide more context? It'll be a simple GlideRecord you'll need to do. Assuming this a glide_list field, and you know the 3 users to populate.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2025 06:10 PM - edited ‎04-24-2025 06:15 PM
I need 3 users on Co-managers. Script above only caters one user

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2025 06:18 PM
If the field is a glide_list, provide it with a string of comma separated sys_ids
*sys_id1,sys_id2,sys_id3"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2025 10:09 PM
that field can hold 3 users only if it's a glide list field
If yes then simply follow what @Kieran Anson mentioned
something like this
var gr = new GlideRecord('sys_user_group');
gr.addEncodedQuery('nameSTARTSWITHBilling team');
gr.setLimit(1);
gr.query();
if(gr.next()){
gr.u_co_manager = '556d03520f064a0035fde478b1050e0d,sysId2,sysId3'; // give other 2 user sysIds here
gr.update();
}
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