Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Workflow - If else condition to check Ownertype for Service Account

krishna_sk
New Contributor III
New Contributor III

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.

3 REPLIES 3

RakeshMG
Saviynt Employee
Saviynt Employee

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 :

https://docs.saviyntcloud.com/bundle/EIC-Admin-v2020x/page/Content/Chapter12-Workflows/Workflow-Comp...


​Regards

Rakesh M Goudar

sk
All-Star
All-Star

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'))

 

sk_0-1677164939556.png

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'))


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

krishna_sk
New Contributor III
New Contributor III

Thank you SK. The logic works for me!!!