Click HERE to see how Saviynt Intelligence is transforming the industry. |
08/21/2024 07:54 PM - last edited on 08/21/2024 11:08 PM by Sunil
We are trying to create a workflow to reject the new Service Account request if more than 1 owner is added by the requestor.
We are using the below query in the if-Else block following the solution - Solved: Re: Service Account Owner Restriction - Saviynt Forums - 81540
However, we are getting the NullPointer exception in the log like below
The dynamicAttributesReqAccess is showing blank in the log
Below is the screenshot of the workflow
Any suggestion on how to resolve the issue?
[This post has been edited by a Moderator. We discourage the @ mention of other forum users or employees unless they have already involved themselves on the forum post.]
Solved! Go to Solution.
08/21/2024 08:22 PM - edited 09/10/2024 10:10 PM
Check value under request_access_attrs table
08/21/2024 09:56 PM
Hi @rushikeshvartak ,
The table is showing limited value like below
This table is not showing any data related to the Service Account Owner.
Any idea how to get the list of the Owner in the workflow?
08/21/2024 10:06 PM
What is kind of request submitted?
08/21/2024 11:20 PM
It's new account request. I am planning to implement the same solution for add owner as well.
08/21/2024 11:21 PM
Did you added owners during request ?
08/22/2024 05:50 PM
Yes. We are adding the owner during new account request.
08/22/2024 07:29 PM
08/26/2024 03:51 PM
Hi @rushikeshvartak ,
The issue is resolved now. Initially, I created the serial workflow which caused the issue. Now I am able to fulfill the logics for new Service Account Creation, however, could you please help me with the modify Service Account Request?
How could we set the workflow to trigger during modify Service Account action to check if more than one Service Account Owners are added and if so then reject the request?
08/26/2024 04:33 PM
You can use same condition mentioned in initial post it works in create as well as modify case
08/29/2024 05:01 PM
Thanks @rushikeshvartak
08/29/2024 05:25 PM
✅Please click the 'Accept As Solution' button on the reply (or replies) that best answers your original question and hit 'Kudos' button 👍.
09/10/2024 09:25 PM
Hi @rushikeshvartak ,
We are using String.valueOf(dynamicAttributesReqAccess.get(requestaccesskey).get('USERRANKJSON')).count(':[1]')==1
in the wrkflow to identify if more than one owner is added to reject the request. This is working fine.
But if we are adding one owner with Primary Certifier rank, it's not working. So, the query is only working when the Owner is single and the rank is Rank 1.
How could we see what's the variable is holding? I tried to search in the logs but no luck.
Do you have any recommendation on how can we modify the above query to allow single owner with Primary Certifier rank?
09/10/2024 09:32 PM
String.valueOf(dynamicAttributesReqAccess.get(requestaccesskey).get('USERRANKJSON')).count(':[1]')==1 or String.valueOf(dynamicAttributesReqAccess.get(requestaccesskey).get('USERRANKJSON')).count(':[26]')==1
09/10/2024 09:37 PM
That works. Just querious, how do we know what's the variable dynamicAttributesReqAccess contains in order to modify or access some properties?
We don't have much documentation around that and also logs are not showing the variable values.
09/10/2024 09:51 PM
Just experience things 🙂
09/10/2024 11:04 PM
Hi @rushikeshvartak, Appreciate your help on this. Now, there is one test case where this query isn't working.
If we are request with 2 owner, 1 is rank 1 and another one is Primary Certifier then the query is allowing the request creation.
As the query is checking if the number of rank1 or rank26 are equals=1.
Is there a way we could check there are more than 1 entries for owner field?
The current query - String.valueOf(dynamicAttributesReqAccess.get(requestaccesskey).get('USERRANKJSON')).count(':[1]')==1 or String.valueOf(dynamicAttributesReqAccess.get(requestaccesskey).get('USERRANKJSON')).count(':[26]')==1
09/10/2024 11:11 PM
String.valueOf(dynamicAttributesReqAccess.get(requestaccesskey).get('USERRANKJSON')) .replaceAll("[^:\\[1]", "").length() == 2 && String.valueOf(dynamicAttributesReqAccess.get(requestaccesskey).get('USERRANKJSON')) .split(":\\[1]").length - 1 == 1 || String.valueOf(dynamicAttributesReqAccess.get(requestaccesskey).get('USERRANKJSON')) .split(":\\[26]").length - 1 == 1