Adding multiple group types via script

shawnbaar
Giga Expert

Good morning,

I am creating a new user group via an automated script and I am a little stuck on how to add a second group type to the group being created.  This is what I have so far:

// Create new manager group
var mgrGroup = new GlideRecord('sys_user_group');
grpType = 'approval';
mgrGroup.initialize();
mgrGroup.name = current.program_name + ' Managers';
mgrGroup.type = grpType;
grpSysid = mgrGroup.insert();

I also need to add the type 'support' as well.  Anyone have any suggestions?

Thanks,

Shawn

1 ACCEPTED SOLUTION

JJ1
Kilo Guru

 

 

mgrGroup.type = "approval,support";

 

 

it should work , please try and let me know.

 

 

Thanks,

JJ

View solution in original post

3 REPLIES 3

JJ1
Kilo Guru

 

 

mgrGroup.type = "approval,support";

 

 

it should work , please try and let me know.

 

 

Thanks,

JJ

JJ, 

    This only takes the approval type. The record will need to be recalled, initialized, and updated. 

Thanks, 

Derrick Johnson

shawnbaar
Giga Expert

That worked perfectly!  Much thanks!