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.

Catalog item : Assigned to depended on assignment group variable

Chirag Pathak
Tera Contributor

Hi community,

 

I have a requirement where I have record producer which has two variable. Variable 1 the user has to select to the assignment group and in variable 2 they have to choose the assigned to. I need group members of assignment group selected in variable 1 to be shown to the users how do I do that?

1 ACCEPTED SOLUTION

ProdiptoL
Tera Expert

Hi @Chirag Pathak 

Variable 1 : Assignment Group [assignment_group] --> This will be a reference type variable which will refer to the Goup [sys_user_group] table.

 

Variable 2: Assigned to [assigned_to] --> This will be a 'List Collector' type field. This field will be refer to the User [sys_user] table.

 

Solution: In the advance reference qualifier of the variable 2 call a script include and pass the selected group's sys_id [current.variables.assignment_group]. Write the script in the script include to query the Group Member [sys_user_grmember] table with the selected group id and create an array of sys_ids of the users present against the group in the Group Member table. return the query as "sys_idIN"+array.join(",");

 

I hope this answer will help you.

View solution in original post

6 REPLIES 6

Still no luck.

 

Hi @Chirag Pathak , Check my screen shot, it is without script include. Let me know if you face any issue.