script within assignment rule

patricklatella
Mega Sage

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);

}

1 ACCEPTED SOLUTION

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.

View solution in original post

15 REPLIES 15

patricklatella
Mega Sage

I've put in the gs.info, which now for some reason is not logging to the system log



find_real_file.png


patricklatella
Mega Sage

I'll try the sys_id for the assignment group


Gowrisankar Sat
Tera Guru

Did you try:



current.assignment_group = '<sys_id>';


patricklatella
Mega Sage

I did.



the script is still broken, won't even log the gs.info parts


patricklatella
Mega Sage

I think the "return;" is the problem