Remove User from Assignment Group with Flow Designer

Gabriel Ho
Tera Contributor

Hi, I`m looking for an "Flow Designer" flow to remove ITIL User from her Assignment Groups.

I dont want to delete the Group, I only want an automatic flow, who can remove the selected Groups from the User Groups (selected in Catalog Item).

 

Have anyone an Idea?

I know, that I can use the table sys_user_grmembers

 

10 REPLIES 10

Here is my script include for the refrence qulifier: 

 

function refqualgroupmemebers(){


var group = current.variables.assignment_group; // your assignment_group variable name
var users = '';
if(group!=''){
var getMembers = new GlideRecord('sys_user_grmember');
getMembers.addQuery('group',group);
getMembers.query();
while(getMembers.next())
{
users = users + ','+ getMembers.user;
}
return 'sys_idIN' + users;
}
else{
return 'active=true';
}
}

Hello,

I'm actually trying to do the same thing. Would you please elaborate the flow process? I'm new to flow designer and not sure how to create the trigger action. Also, I understand that the question for the group you have created is by variable set, but how did you manage to filter the members by the group selected?

Ed Hefford
Tera Guru

Hi @Pedram Haghzaban  @Gabriel Ho 

variable on the multi row variable set is very simple, one line works for me.

find_real_file.png

assignment_group is a lookup select box based on the group field.

assignment_user is a reference with the qualifer of "javascript:u_getMembers(current.variables.assignment_group);"

Thats it!

Hello,

Thanks for the reply.

Is this what you meant for user:

find_real_file.png

And this for group:

find_real_file.png

If so, I ran into this issue where it shows lots of duplicates for assignment group. Still shows all the users. So it looks like I'm making a mistake somewhere.

The other issue I ran into is with the flow steps. I tried to replicate your image, but wasn't sure on little details on each action.

Here is what I have:

I tried requested item record pill but whenever I try to save it, it loops for ever and never finishes

find_real_file.png

For each:

find_real_file.png

Delete Record:

find_real_file.png

 

Update Record:

find_real_file.png


Thanks

Hi @Pedram Haghzaban , if you click on the checkboxes for your assignment group variable to show the following, this will remove the duplicates. For each entry within the groups table, you'll have a record. Checking the unique values only reduces the results to 1.

find_real_file.png

 

With regards to your flow for Get Catalog Variables, you need to select the trigger record as Submitted Request Item where you field is mandatory.

find_real_file.png

For the final step 7, I update the RITM by setting the below values

find_real_file.png