Add users to group using service catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-06-2022 12:40 AM
I've requirement to add users to group using catalog item in service catalog. I'm new to this please help me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-06-2022 02:42 AM
Hi,
I would say the easiest way would be to create an item with two variable, one has the reference to the group table and one has the reference to the user table. (and possible additional condition like is the group/user active)
Than create flow which gets triggered via request and just create record in the Group Member Table with the group / user information you get from the request.
Add the flow in the last step to our item.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-06-2022 06:47 AM
Hi Deepika,
do you also required approvals before creating record , if so you need to follow different approach , if no approval is required Just use Runscript in the workflow and add this code
var group = current.variables.add_group;
var user = current.variables.add_member.toString();
var array = user.split(",");
for (var i = 0; i < array.length; i++) {
var gr_member = new GlideRecord('sys_user_grmember');
gr_member.initialize();
gr_member.group = group;
gr_member.user = array[i].toString();
gr_member.insert();
}
Please mark the response as helpful/correct, if it answers your question.