Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Set assignment group in Field, if Logged in User is a part of 'London Creator' assignment Group.

Star123
Tera Contributor

Hello All,

 

I have a requirement, If a logged In user is a Part of "London Creator" Group. after Submitting a request from

Record Producer. in Native Form there is one Field Creator Group, so it should filled with the assignment group name.

 

Please help me the solution.

thankyou.

8 REPLIES 8

try this

 

if ( gs.getUserID().isMemberOf(“London Creator”){
current.setValue(‘filedName’, ‘fieldValue’);

}


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

@Star123 ,

Lets assume your string field name is called as u_creator_group

 

You need to Include this script in RP Script

if(gs.getUser().isMemberOf("london creator group"){
current.u_creator_group= 'test test’;
}

 

Regards,

Shyamkumar

 

 

 

Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar

Star123
Tera Contributor

so we can do that in record producer's script ? is it possible to set native side field value from record producer? and what will happen if Logged in user is part of multiple groups?

 

 

Sumanth16
Kilo Patron

Hi @Star123 ,

 

 

if(gs.getUser().isMemberOf("london creator grou"){
 current.assigned_group = 'add sysid of group here'
}

 

If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!

 

Thanks & Regards,

Sumanth Meda