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

Approval workflow custom assignment issue

itinjic
New Contributor III
New Contributor III

Hi

I created an access approval workflow that has three steps.

1.Step : Manager approval

2.Step: First user group approvers

In this step I use custom assignment but this doesn't work. (here for the value of the filter in sql code I take the value from the user customproperty field)

itinjic_0-1709223809834.png

SQL query : 

select userkey from usergroup_users WHERE USER_GROUPKEY IN (SELECT UG.USERGROUPKEY FROM USER_GROUPS UG WHERE USER_GROUPNAME = (SELECT CASE WHEN LOWER('XXX') = 'Yyy' THEN 'YYY Admin Approvers' WHEN LOWER('XXX') = 'Zzz' THEN 'ZZZ Admin Approvers' WHEN LOWER('XXX') = 'Qqq' THEN 'QQQ Admin Approvers'  ELSE 'XXX Admin Approvers' END))

When I execute this query in sql builder I get results as user keys.
itinjic_1-1709224109731.pngitinjic_2-1709224177630.png

 

So in this user group I have two users. First is admin user and that user can approve this request because it has admin permissions, but this request is not visible to another user (who has end user role as SAV role and one more role that have permissions for approval)

This is view from second user:
itinjic_4-1709224435244.png

 

 

 

3. Step: Second user group approvers
This step is similar to step 2 only a slightly different sql query is used (here for the value of the filter in sql code I take the value from the dynamic attribute).

itinjic_5-1709224844287.png

 



11 REPLIES 11

AmitM
Valued Contributor
Valued Contributor

HI @itinjic , what is not working ? is the approval request not assigned to those two users or one of the user is not able to view pending approval ?

your query outcome is user key where in select user field is user group. You can either change your query where the outcome is user_groupkey OR change the selection field to customquery.

Thanks,

Amit

If this answers your query, Please ACCEPT SOLUTION and give KUDOS.

Thanks,

Amit

CR
Regular Contributor III
Regular Contributor III

@itinjic  please change custom assignment selected field USERGROUP to CustomQuery

you're passing sql query need to use customquery and try it.


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

Manu269
All-Star
All-Star

I see an issue with the custom assignment block.

You are using a query but passing User group.

Please change that to custom query.

It should work.

Regards
Manish Kumar
If the response answered your query, please Accept As Solution and Kudos
.

rushikeshvartak
All-Star
All-Star
  • Always make sure below when using Query in  Custom Assignment block
    • Make sure Select User Field = CustomQuery
    • Result should return userkey as column alias
  • rushikeshvartak_0-1709269473563.png

     


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

itinjic
New Contributor III
New Contributor III

I changed this option to CustomQuery but still the same thing happens. I think the issue is in the last part of sql query (marked in red). When I omit that part and when I put a hardcoded value , for example "XXX Admin Approvers" then everything works fine and the user from the approver group can approve request. Here I need to use information from the user for whom the access request was  created as #{user.customproperty2}).  

select userkey from usergroup_users WHERE USER_GROUPKEY IN (SELECT UG.USERGROUPKEY FROM USER_GROUPS UG WHERE USER_GROUPNAME = (SELECT CASE WHEN  LOWER(#{user.customproperty2}) = 'yyy' THEN 'YYY Admin Approvers' WHEN LOWER(#{user.customproperty2}) = 'zzz' THEN 'ZZZ Admin Approvers' WHEN LOWER(#{user.customproperty2}) = 'qqq' THEN 'QQQ Admin Approvers'  ELSE 'XXX Admin Approvers' END))

AmitM
Valued Contributor
Valued Contributor

Hi @itinjic , #{user.customproperty2} is this a typo and you are actually using ${user.customproperty2}.

If not typo, correct that and use ${user.customproperty2} instead. 

This page has the syntaxes - https://docs.saviyntcloud.com/bundle/EIC-Admin-v24x/page/Content/Chapter12-Workflows/Workflow-Compon...

Thanks,

Amit

If this answers your query, Please ACCEPT SOLUTION and give KUDOS.

itinjic
New Contributor III
New Contributor III

I tried both (${user.customproperty2} and #{user.customproperty2}) but it doesn't work it can not read the values from user field customproperty2

AmitM
Valued Contributor
Valued Contributor

Try this :

select userkey from usergroup_users WHERE USER_GROUPKEY IN (SELECT UG.USERGROUPKEY FROM USER_GROUPS UG WHERE USER_GROUPNAME = (SELECT CASE WHEN '${user.customproperty2}' = 'yyy' THEN 'YYY Admin Approvers' WHEN '${user.customproperty2}' = 'zzz' THEN 'ZZZ Admin Approvers' WHEN '${user.customproperty2}' = 'qqq' THEN 'QQQ Admin Approvers' ELSE 'XXX Admin Approvers' END))

AmitM
Valued Contributor
Valued Contributor

Share logs this time if it doesn't work and also, if you can try with ${RequestedFor.customproperty} instead of user object also.

itinjic
New Contributor III
New Contributor III

Thanks  @AmitM its work now , looks like the '' symbols should have been added  to the beginning and end of ${user.customproperty2}. 

'${user.customproperty2}'

I also used this approach in the third approval step when I retrieve data from dynamic attributes and its work.

 

Maybe this has something to do with the type of data it checks because t checks against string values 🤔

AmitM
Valued Contributor
Valued Contributor

Good to hear it worked!!