Assignment Group routing

KS11
Kilo Expert

Hi,

I have a field called 'v_location' - a reference type variable.

Ask is to route the Assignment Group based on the field value of 'v_Location. 

If the location value is either A, B or C, then route to Assignment Group 'DNS'  also set the short description to 'Validate equipment received'

else if v_location values is NOT A, or B or C,  THEN the Assignment group should be routed to the the v_location Local support group & also set the short description to 'Install & Retrieve equipment'

I am trying to add the above code in the Advanced script of the Workflow activity.

Would appreciate any help to have this coded.

Thanks

KS

2 ACCEPTED SOLUTIONS

Syedmd08
Kilo Guru

var v_location = current.variables.v_location;

if (v_location == "A" || v_location == "B" || v_location == "C") {
current.assignment_group.setDisplayValue('DNS');
current.short_description = 'Validate equipment received';
}
else {
var locationGr = new GlideRecord('u_local_support_group_table');
locationGr.addQuery('u_location', v_location);
locationGr.query();
if (locationGr.next()) {
current.assignment_group.setDisplayValue(locationGr.u_local_support_group.toString());
current.short_description = 'Install & Retrieve equipment';
}
}

 

In this code, we first get the value of the 'v_location' variable and then use an 'if' statement to check if it is equal to "A", "B", or "C". If it is, we set the Assignment Group to "DNS" and the short description to "Validate equipment received". If it's not equal to "A", "B", or "C", we query a custom table 'u_local_support_group_table' to find the local support group associated with the 'v_location' value and set the Assignment Group to that group. We also set the short description to "Install & Retrieve equipment".

Note that you'll need to replace 'u_local_support_group_table' with the actual name of your custom table, and 'u_location' and 'u_local_support_group' with the actual names of the columns in that table that store the location and local support group values, respectively.

 

Please mark my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

Nitin22
Tera Expert

if you want to do it in workflow you need to code using server side. You can use something like

 

if(current.v_location == 'A' ||current.v_location== 'B' || current.v_location== 'C'){

current.assignment_group= "sysid of DNS group";

current.short_description='Install & Retrieve equipment.'.

}

View solution in original post

3 REPLIES 3

Nitin22
Tera Expert

You can write a on change client script on "v_location" field. Something like

 

if(g_form.getValue('v_location') == 'A' ||g_form.getValue('v_location') == 'B' || g_form.getValue('v_location') == 'C'){

g_form.setValue('assignment_group',"sysid of DNS group")

g_form.setValue('short_description,'Install & Retrieve equipment.')

}

 

Syedmd08
Kilo Guru

var v_location = current.variables.v_location;

if (v_location == "A" || v_location == "B" || v_location == "C") {
current.assignment_group.setDisplayValue('DNS');
current.short_description = 'Validate equipment received';
}
else {
var locationGr = new GlideRecord('u_local_support_group_table');
locationGr.addQuery('u_location', v_location);
locationGr.query();
if (locationGr.next()) {
current.assignment_group.setDisplayValue(locationGr.u_local_support_group.toString());
current.short_description = 'Install & Retrieve equipment';
}
}

 

In this code, we first get the value of the 'v_location' variable and then use an 'if' statement to check if it is equal to "A", "B", or "C". If it is, we set the Assignment Group to "DNS" and the short description to "Validate equipment received". If it's not equal to "A", "B", or "C", we query a custom table 'u_local_support_group_table' to find the local support group associated with the 'v_location' value and set the Assignment Group to that group. We also set the short description to "Install & Retrieve equipment".

Note that you'll need to replace 'u_local_support_group_table' with the actual name of your custom table, and 'u_location' and 'u_local_support_group' with the actual names of the columns in that table that store the location and local support group values, respectively.

 

Please mark my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Nitin22
Tera Expert

if you want to do it in workflow you need to code using server side. You can use something like

 

if(current.v_location == 'A' ||current.v_location== 'B' || current.v_location== 'C'){

current.assignment_group= "sysid of DNS group";

current.short_description='Install & Retrieve equipment.'.

}