Hi team,
I have struck with the situation where the user accounts get created through Form like structure which created through Journey.
So, After collecting organization name to which the user has to belong, I have created event hooks to create relationship with organization based on below suggestion.
How to assign organization to user identities added through bulk import in Identity Cloud - Integrations - ForgeRock Community
The problem I am facing is I also have update form to update existing user and I created option to modify organization to which they belong. With current execution whenever the change happens the event hooks will create another relation with new organization, but previous organization still exist.
I got suggestion to do “remove” operation, but it is working for “/parent” object, but for “/memberofOrg/-” it is not working. Below is sample code I used to removal operation which is not working…
var orgID = object.orgID
var patchedUser = openidm.patch(“managed/alpha_user/” + object.username, null, [{
“operation”:“remove”,
“field”:“/memberOfOrg/-”,
“value”:{“_ref”:“managed/alpha_organization/”+orgID+“”,“_refProperties”:{}}
}]);
I need suggestion where I can make changes to remove all previous relations made. Thank you in advance!