Flow that automates adding group type to a user group with specific conditions

Wendy20
Tera Expert

Hi all,

I am looking to create a flow that automates adding "group type" to a user group  that contain a certain word. for example all groups that contain the word "change" will be added Group type "ITIL".  Any advice on how to do this with flow designer will be appreciated. Thank you!

2 ACCEPTED SOLUTIONS

Hi,
You can create a onBefore insert a business rule with condition name contain "change" set type as "ITIL".

SaurabhGupta_0-1672175715917.png

 

SaurabhGupta_1-1672175727956.png

 

 

 


Thanks and Regards,

Saurabh Gupta

View solution in original post

Hi,
Remove set Action value as itil and check the advance checkbox and write below code

 

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	var curTyArr=[];
	var curTy=current.getValue('type');
	if(curTy)
		curTyArr=curTy.split(",");
	curTyArr.push("1cb8ab9bff500200158bffffffffff62");//Type as ITIL
	var au=new ArrayUtil();
	current.setValue('type',au.unique(curTyArr).join(","));//


})(current, previous);

 

 


Thanks and Regards,

Saurabh Gupta

View solution in original post

6 REPLIES 6

Saurabh Gupta
Kilo Patron
Kilo Patron

Hi,
Is it a one time job, where are going to save this kind of relation (eg all groups that contain the word "change" will be added Group type "ITIL".)

 

 

 


Thanks and Regards,

Saurabh Gupta

it's a continuous job for whenever a new group is created with name containing the word "change"

Hi,
You can create a onBefore insert a business rule with condition name contain "change" set type as "ITIL".

SaurabhGupta_0-1672175715917.png

 

SaurabhGupta_1-1672175727956.png

 

 

 


Thanks and Regards,

Saurabh Gupta

Thank you. This is working. is there a way to make so if the groups are created with a different type to add "itil" type instead of replacing all the group types. Some of the groups have multiple types. for example if the new group containing "change" is created with group type "approval" but we need to also add group type "itil". This business rule will eliminate "approval" type and replace with ITIL group type.