Group manager update
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2024 01:54 AM
Can anyone help me how can we update the group manager of a group in sys_user_group table for multiple.records using script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2024 02:10 AM
That all depends on your requirement. Do you need to update multiple records with the same new manager? Do you need logic to select manager a, replacing with b and manager c with d?
Is this something to run one time, or regularly (automated)?
Based on the limited information, this is the script:
var group = new GlideRecord('sys_user_group');
group.addQuery('your_query_to_select_the_group(s)');
group.query();
while(group.next()){
group.setValue('manager','sys_id_of_new_manager');
group.update();
}
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
‎08-12-2024 02:41 AM
Hi mark , thanks for the reply .
We need to update the multiple group records with different group managers and for now it is for one time run . Can you please suggest if there is any script for that
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2024 03:27 AM - edited ‎08-12-2024 04:51 AM
Do you need to do this via a script? What number are of changes or variations are we looking at.
I often find using the list edit and 'Update Selected' option far easier, quicker and 'safer' to update.
You can either cherry pick records, or you can use the filter to search for you record set and 'Update All'.
@Ankitha4 To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.

Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2024 03:37 AM
In that case you have to explain your logic, or just do a manual 'update all' action. Because without knowing your logic, the only answer will be: use the script I already provided and put a lot of 'if/else' in there.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark