- 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:09 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2017 12:10 PM
I'll try the sys_id for the assignment group

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2017 12:10 PM
Did you try:
current.assignment_group = '<sys_id>';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2017 12:12 PM
I did.
the script is still broken, won't even log the gs.info parts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2017 12:13 PM
I think the "return;" is the problem