Blank users and groups in group member table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2018 03:31 PM
Hi All,
I am trying to update group membership using run script in workflow. Script is working fine and able to add and remove users from group membership.
I have one issue, while adding record is creating with blank values and same way while removing the user. Is anyone facing the same issue?
Sometimes both user and groups are blank and sometimes only group is blank.
Please suggest.
Thanks,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2018 03:38 PM
Please post your script here, and I will review it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2018 03:46 PM
HI Jon,
Thanks for the reply.
var gr = new GlideRecord("u_grp");
gr.addEncodedQuery("sys_idIN"+current.variables.available_grp);
gr.query();
var gr_names = "";
while (gr.next()) {
var grm = new GlideRecord('u_grp_member');
grm.initialize();
grm.u_assignee=current.variables.user_name;
grm.u_grp=gr.sys_id;
grm.insert();
}
with the above script, group name is visible but user name is blank
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2018 05:01 PM
Modified the script and it works
var gr = new GlideRecord("u_grp");
gr.addEncodedQuery("sys_idIN"+current.variables.available_grp);
gr.query();
var gr_names = "";
while (gr.next()) {
var grm = new GlideRecord('u_grp_member');
grm.initialize();
grm.u_assignee=workflow.scratchpad.userID;
grm.u_grp=gr.sys_id;
grm.insert();
}