diff --git a/templates/create-user-add-to-vre.json.j2 b/templates/create-user-add-to-vre.json.j2 index eb4adac..03c62a5 100644 --- a/templates/create-user-add-to-vre.json.j2 +++ b/templates/create-user-add-to-vre.json.j2 @@ -155,7 +155,7 @@ "inputParameters": { "tree" : "${init.output.result.tree}", "groups" : "${look_up_groups.output.body}", - "scriptExpression": "function selectByPath(groups, path, level, acc), { for (var i=0; i < groups.length; i++) {if (groups[i].name === path[level]) {acc.push(groups[i]); if (level === path.length - 1) return acc;return selectByPath(groups[i].subGroups, path, level+1, acc)}} return []; } return { 'groups' : selectByPath($.groups, $.tree, 0, [])}" + "scriptExpression": "function selectByPath(groups, path, level, acc){ for (var i=0; i < groups.length; i++) {if (groups[i].name === path[level]) {acc.push(groups[i]); if (level === path.length - 1) return acc;return selectByPath(groups[i].subGroups, path, level+1, acc)}} return []; } return { 'groups' : selectByPath($.groups, $.tree, 0, [])}" } }, {