- 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
12-14-2017 12:15 PM
please try checking gs.log instead of gs.info
and also I think dot walk will support only upto 4 steps. so that could be the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2017 12:14 PM
I think I have it working...just need to change my function in the script include

- 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
12-14-2017 12:21 PM
Hi Sanjiv,
I think that's close, it's calling the script include if the region is not "NA", but it's not passing the region to the script include properly...it's passing "NA" even if region is not 'NA'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2017 12:25 PM
I got it...had to correct the script include one more time. Here's my final script: thanks everyone!
var region;
region = current.variables.user.location.u_region;
if(region == 'NA'){
current.assignment_group = '0eae18fb4f638e004100029d0210c77b';
}else{
var region;
region = current.variables.user.location.u_region;
var AssignmentScripts = new u_CubicAssignmentScripts();
current.assignment_group = AssignmentScripts.GetDesktopSupportGroup2(region);
}