Set assignment group based on field value

vcaracci75
Tera Expert

I have a service Request that I would like to have auto-assigned based on a value from one of the variables. The variable is a reference field called "it_team" and it references the sys_user_group table. can I do this via the workflow, or do I have to use a catalog client script? IF so, how would I do that?

Thanks!

1 ACCEPTED SOLUTION

Oh, okay.   No worries, we all start somewhere



That would be even easier.   In the Run Script activity, add:



current.assignment_group = current.variable_pool.it_team;


current.update();



To my knowledge, you can only use table fields, not catalog variables in the 'Set Values' activity.


View solution in original post

13 REPLIES 13

Sorry, read this too quickly.   I didn't realize you wanted to assign the Request.   You would do that in a 'Run Script' activity.


var req = new GlideRecord('sc_request');


req.get(current.request);


req.assignment_group = current.variable_pool.it_team;


req.update();



**caveat: Didn't debug, just threw that out from memory.


Well, I want to assign the RITM. If I use a Run Script, what would my script look like. Sorry, I'm a fairly new admin.


Oh, okay.   No worries, we all start somewhere



That would be even easier.   In the Run Script activity, add:



current.assignment_group = current.variable_pool.it_team;


current.update();



To my knowledge, you can only use table fields, not catalog variables in the 'Set Values' activity.


Hi Danny,


Thanks for the quick responses! Sooo...I've attached my script below. It doesn't appear to work. What am I doing wrong?


Run Script.JPG