When the proposed by is the member of "ABC" group then assign the MIM to "ABC" group

rmishra4395
Tera Contributor

Hello Team,

 

I need help here ASAP.

 

 

When the proposed by is the member of "ABC" group then assign the MIM to "ABC" group

 

 

Thanks in Advance

1 ACCEPTED SOLUTION

Runjay Patel
Giga Sage

Hi @rmishra4395 ,

 

You can write before business rule and use below script.

 var userGroups = new GlideRecord('sys_user_grmember');
    userGroups.addQuery('user', current.proposed_by);
	userGroups.addEncodedQuery('group.name=ABC');
    userGroups.query();

    if (userGroups.next()) {
       current.assignment_group='sys_id of ABC assignement group'
    }

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

 

 

View solution in original post

1 REPLY 1

Runjay Patel
Giga Sage

Hi @rmishra4395 ,

 

You can write before business rule and use below script.

 var userGroups = new GlideRecord('sys_user_grmember');
    userGroups.addQuery('user', current.proposed_by);
	userGroups.addEncodedQuery('group.name=ABC');
    userGroups.query();

    if (userGroups.next()) {
       current.assignment_group='sys_id of ABC assignement group'
    }

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------