Does anyone have an example of assigning a user role inside “scripted decision node”
A conventional method of setting attribute throws an error regarding incorrect format for “relationship” attribute type.
Here is an example another thing that I tried:
var myArray = new Array();
myArray.push(‘{“_ref”: “managed/alpha_role/myRoleName”}’);
var object = sharedState.get(“objectAttributes”)
object.roles = myArray;
Here is the error:
errorMessage=Invalid value format for relationship array
But in case user already has provisioning roles assigned, the above code remove all other roles and assigns this one.
I tried to get already assigned roles in array but still can not make it work.
Do you have any working snipet of code where user user already has a prov role assigned and another needs to be assigned in Scripted decision node?