- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2017 11:58 AM
Hi all,
seeing some odd behavior from my script within an assignment rule. What I need is, if the current user's region is "NA" then it executes that part of the script, and if it's not "NA", then for it to call the script include at the bottom of the script.
Having trouble getting it to work...anyone see what's wrong? I've got it returning the region correctly, but the assignment group is not getting assigned properly...even if the region='NA'.
thanks!
var region = current.variables.user.location.u_region;//looks up current user's location
if(region == 'NA'){
current.assignment_group = 'UC Services';
return;
}else{
var AssignmentScripts = new u_CubicAssignmentScripts();
current.assignment_group = AssignmentScripts.GetNewHireGroup(region);
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2017 12:16 PM
The script should have been
var region = current.variables.user.location.u_region;//looks up current user's location
if(region == 'NA'){
current.assignment_group.setDisplayValue('UC Services');
}else{
var AssignmentScripts = new u_CubicAssignmentScripts();
current.assignment_group = AssignmentScripts.GetNewHireGroup(region);
}
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2019 01:36 PM
Hey there,
My two cents.
Working on an assignment rule to use with case table.
Create assignment rule. Applies to Case, under these conditions (arbitrary).
Assign To OR Script.
I had picked Assign To > User > leave empty, Assign To > Group > a_group.
Then under script, I was doing some logic to call this and that to pick a_user and set current.assigned_to = a_user;.
When I tested this, it would only set the group, then bail. Never running my script, not even for a gs.info('test');.
I removed the choices on Assign To, having them both left empty, my script ran.
Seems like the functionality of this is either or, not Assign To, and then further script to run after these fields have been set, allowing you to overwrite or whatnot.