Workflow script to set SCTask Assignment Group based on Variable

Josh Pirozzi
Kilo Sage

We are trying to set the SCTask Assignment Group Routing based on a Request Form Variable. The variable is a Reference type that is pulling data from our sys_user_group table. What is the best way to script this on the workflow Catalog Task node? I've attempted a couple of options and, because I'm not strong in scripting, couldn't get it to work.

1 ACCEPTED SOLUTION

Filipe Cruz
Kilo Sage
Kilo Sage

Hello Josh,

Please refer to this thread that will help you for sure:

Using RITM variables in workflow

You can access RITM variables in workflow in the following way:

current.variables.variable_name

being "variable_name" the name of the variable that has the reference to the sys_user_group.

Hope this helps you!

Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!

Best Regards,

Filipe Cruz

View solution in original post

2 REPLIES 2

Filipe Cruz
Kilo Sage
Kilo Sage

Hello Josh,

Please refer to this thread that will help you for sure:

Using RITM variables in workflow

You can access RITM variables in workflow in the following way:

current.variables.variable_name

being "variable_name" the name of the variable that has the reference to the sys_user_group.

Hope this helps you!

Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!

Best Regards,

Filipe Cruz

Hi Filipe!

Thank you for the information! It was helpful and, what worked for our situation was:

var grp = new GlideRecord('sys_user_group');
grp.addQuery('assignment group',current.variables.please_select_the_appropriate_application_team_for_their_review);
grp.query();
if (grp.next())
{
task.assignment_group = current.variables.please_select_the_appropriate_application_team_for_their_review;
}

 

Adding this script to our Catalog Task Workflow Node allows us to set the Assignment Group on the SCTask form based on the Reference Variable. The Reference pulls from the sys_user_group table.

 

Thanks again!!

-Josh