How to add multiple assignment groups in single Assignment rule using script

Srikanth Cheruk
Kilo Contributor

Hi,

I have created an assignment rule and added one group(A) to Assigned to Group using a script.

if(condition ='true'){

current.assignment_group.setDisplayValue("A");

}

The above code is working fine.

Now I have a requirement where need to add three groups(A, B & C) in the Group field using the script.

Something like this: 

if(condition ='true'){

current.assignment_group.setDisplayValue("A;B;C");

}

is this possible or is there any workaround for this?

1 ACCEPTED SOLUTION

Anil Lande
Kilo Patron

Hi,

Assignment group field is of type Reference and it can hold only one value at a time.

It is not possible to set multiple assignment groups by any way. 

 

Thanks,
Anil Lande

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

View solution in original post

5 REPLIES 5

Anil Lande
Kilo Patron

Hi,

Assignment group field is of type Reference and it can hold only one value at a time.

It is not possible to set multiple assignment groups by any way. 

 

Thanks,
Anil Lande

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Hi @Anil Lande ,

Thanks for your response,

 is there any other alternative approach for this kind of scenario? or appreciate your thoughts on this?

You can create custom field on your table to add additional assignment groups. 

Create a field of type 'List' referring to Group 'sys_user_group' table.

This can be used to populate additional assignment groups. Please check the behavior Watch List / Work Notes List field behavior.

find_real_file.png

 

Thanks,
Anil Lande

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

group field is reference field then it will hold only 1 value

how it would hold 3 groups?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader