Blank users and groups in group member table

Hitesh targe
Tera Expert

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.

find_real_file.png

 

Thanks,

3 REPLIES 3

Jon Barnes
Kilo Sage

Please post your script here, and I will review it

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

 

find_real_file.png

Hitesh targe
Tera Expert

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();

}