SRC Approval definition based on substr of user selection value

I'm trying to get an approval definition to execute based on the results of the substr function applied to the value of a user selection field in SRC. So far, it either doesn't work or returns an error.

For example, the value entered for user selection "xcelSRCGenericTypeOne" is ug-esb-dev-xdev

I have an approval definition that calls a javascript function with the value of "xcelSRCGenericTypeOne" as the input parameter:

jscall("xcelSRCUNIXGroupUtils.PrivAccessCheck", "xcelSRCGenericTypeOne")="yes"

The javascript is as follows:

function PrivAccessCheck(unixGroupName)


var PrivAccess="no";

var unixGroupPreFix=unixGroupName.substring(1,3); 

if (unixGroupPreFix=="ug-")


return PrivAccess;


This does not cause the approval definition to execute.