and more in a single search tool across platforms. Read the announcement here. |
02/22/2023 10:32 PM - edited 02/22/2023 10:34 PM
Hi all,
We are working on Service account Workflow and we have the following usecase which we need your help on
- If Ownertype is selected as 'User' in ARS > Manage Service accounts then the request will goes to Next step.
-IF Ownertype is selected as 'User group' then the request needs to be rejected.
Could you help us in sharing the If-else condition query in workflow to achieve the above use case.
Thank you.
Solved! Go to Solution.
02/22/2023 11:24 PM
Please use Custom Query
Application owners can route request approvals based on user access criteria.
For the service account request, a service account owner (user or usergroup) needs to approve the request.
This value is currently stored in request_access_attrs table where, ownertype = 2 for a usergroup and ownertype = 1 for the users.
And based on the out generate the next step in workflow.
For more details on sample query please refer to following link :
02/23/2023 07:11 AM
We had similar use case and we achieved with below logic with groovy as expression language
Below logic is checking if only usertype owner is added and whether that owner is of Rank1 or not. We are not accepting multiple owner. Only one owner of Rank 1 who is of user type.
String.valueOf(dynamicAttributesReqAccess.get(requestaccesskey).get('USERRANKJSON')).count(':1')==1 and !(String.valueOf(dynamicAttributesReqAccess.get(requestaccesskey).get('USEROWNERKEYADDED')).contains(',')) and !(String.valueOf(dynamicAttributesReqAccess.get(requestaccesskey)).contains('USERGROUPOWNERKEYADDED'))
But for your case you can use just below condition if outcome is yes that means group is added as owner
(String.valueOf(dynamicAttributesReqAccess.get(requestaccesskey)).contains('USERGROUPOWNERKEYADDED'))
02/24/2023 02:16 AM
Thank you SK. The logic works for me!!!