Script to Set assignment group for record producer

Nolan3
Mega Guru

Hello,

I am trying to figure out how to set the default assignment group on a particular record producer.   Ideally, the script would be as simple as setting the assignment group to our service desk whenever that piratical record producer is used to create the record.     I see where I can add a script to the record producer just not sure, how the script can be set to look at the name of the record producer and set assignment group or if that is the correct way to approach it.

Here is my attempt at doing this but the part I am not sure how to script is what I have in bold.  

if(producer.name.getDisplayValue == 'Submit a Request to IT(RP)')

{

        current.assignment_group = 'sys_id of the group';

}

Disclaimer:   I am a service now administrator of our instance but I am not a programmer and after searching the community I couldn't find a script that I could adapt to my needs.

I appreciate any help someone could provide.  

Thanks,

Nolan

1 ACCEPTED SOLUTION

Michael Fry1
Kilo Patron

If you're using the script field in the record producer, you can just use the following to set the assignment group:


        current.assignment_group = 'sys_id of the group';


View solution in original post

6 REPLIES 6

Michael Fry1
Kilo Patron

If you're using the script field in the record producer, you can just use the following to set the assignment group:


        current.assignment_group = 'sys_id of the group';


Wow even easier then I was thinking thank you very much Michael for the fast help.  


Can also do a current.assignment_group.setDisplayValue('Service Desk'); or whatever its label is so you don't have to use sysID.   But if you ever change the name of the group you'd have to change the code too.


Good to know Alan Thanks for the information.