- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2019 07:23 PM
Hi guys,
Using flow designer, how can I automate the fulfilling of a catalog task that adds users to different groups.
The request contains a list collector of all the groups the user needs to be added.
Below is the flow, I can't seem to select the group when I try to create the record in the sys_user_grmember record.
Thank you in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2019 10:29 AM
Found out that this feature(For Each Logic on Variables) is still not supported in Flow Designer.
PRB1343826
Alternatively, custom action can be used.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2020 11:41 AM
Hi Imran,
Sorry for the delay. We have not rolled this out.
But to start, I created an action called "Create Group":
and below is the script:
(function execute(inputs, outputs) {
//*** Create group ***//
var grp = new GlideRecord('sys_user_group');
grp.initialize();
grp.name = inputs.name;
grp.manager = inputs.manager;
grp.type = inputs.type;
var groupId = grp.insert();
//*** Add ITIL role to the group *** //
if(groupId){
var grRole = new GlideRecord("sys_group_has_role");
grRole.initialize();
grRole.group = groupId;
grRole.setValue("role","9aaaa632844fa400c50c3aed6c7cc667"); //itil
grRole.setValue("inherits",true);
grRole.insert();
}
// *** Add members *** //
var grmem = new GlideRecord('sys_user_grmember');
var usr = new GlideRecord('sys_user');
usr.addQuery("sys_id","IN",inputs.members);
usr.query();
while(usr.next()){
grmem.initialize();
grmem.group = groupId;
grmem.user = usr.sys_id;
grmem.insert();
}
})(inputs, outputs);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2020 06:03 AM
thank you.. will try it out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2020 02:18 PM
Can someone share the output I have been trying to prepare a combination of create a user group which I successfully did but I am not able to add members in the group. I have tried to use a subflow/ action but no go.. I need to close this urgently. Can someone get back to me asap.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2020 03:08 PM
Are you adding a single user to the newly created group?
If so, just create a record to the sys_user_grmember.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2020 03:28 PM