Update Group Managers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-21-2023 01:01 AM
A script needs to be written to update group manager for servicenow groups in sys_user_group.list table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-21-2023 01:07 AM
var groupName = "YourGroupName"; // Replace with the name of the group you want to update.
var newManager = "NewManagerUserID"; // Replace with the sys_id of the new manager user.
var group = new GlideRecord("sys_user_group");
if (group.get("name", groupName) && newManager) {
// Set the new manager for the group.
group.setValue("manager", newManager);
group.update();
gs.print("Group manager updated successfully.");
} else {
gs.print("Group not found or invalid manager user.");
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-21-2023 01:12 AM
Hi Harish,
Thanks for your suggestion. But we need to update multiple group managers in multiple groups (sys_user_group.list) table