and more in a single search tool across platforms. Read the announcement here. |
03/03/2024 05:57 PM
Hi Team,
We have two level approvals in the workflow where the approvers are getting from the prefix of requestee's customproperty, for example, the first 6 digits of the customproperty10 refers to the first approver and the first 6 digits of the customproperty11 refers to the second approver.
So, we would like to check in the workflow if the first approver and the second approver are the same person. If they are the same person, the workflow will skip the first level approval and route directly to the second level approval.
Appreciate your help on this.
Solved! Go to Solution.
03/03/2024 07:02 PM - edited 03/03/2024 09:38 PM
Hi @janice , You can try something like below in workflow if else block and by selecting language as "Groovy"
(com.saviynt.ecm.identitywarehouse.domain.Users.executeQuery("select u.id from users u where SUBSTRING(u.customproperty10,1,7)=SUBSTRING(u.customproperty11,1,7) and u.id = 'userkey').size()==1)
03/04/2024 06:19 PM
Hi @NM ,
Thank you very much for your help. I've tried a few queries as below but it returns error while submitting the request:
1) (com.saviynt.ecm.identitywarehouse.domain.Users.executeQuery("select u.id from users u where SUBSTRING(u.customproperty10,1,7)=SUBSTRING(u.customproperty11,1,7) and u.id='${user?.id}'").size()==1)
2) (com.saviynt.ecm.identitywarehouse.domain.Users.executeQuery("select u.id from users u where SUBSTRING(u.customproperty10,1,7)=SUBSTRING(u.customproperty11,1,7) and u.id='${user.id}'").size()==1)
3) (com.saviynt.ecm.identitywarehouse.domain.Users.executeQuery("select u.id from users u where SUBSTRING(u.customproperty10,1,7)=SUBSTRING(u.customproperty11,1,7) and u.id=${user.id}").size()==1)
03/04/2024 07:45 PM - edited 03/04/2024 07:46 PM
Hi @janice, have you selected language as "groovy" in if else condition?
and what error do you see in the logs?
03/05/2024 01:09 AM
Hi @NM ,
Yes, I have selected the language as "groovy" and the log viewer shows nothing.
03/05/2024 01:39 AM
Hi @janice , Try hardcoding userkey in the workflow and see what result you get..and extract logs when you are trying to submit the request
03/07/2024 11:48 PM
Hi @janice, Did it work we are also planning to use the samem
03/11/2024 06:37 PM
Hi @NM ,
Tried hardcoding but still the same.
Our log viewer seems like having some issue now, hence unable to share the log at the moment. But will share the log once we got it.
03/11/2024 07:29 PM
Share workflow screenshot
03/12/2024 08:23 PM
03/12/2024 08:32 PM - edited 03/12/2024 08:37 PM
Use Updated Query, AND should be capital
(com.saviynt.ecm.identitywarehouse.domain.Users.executeQuery("select u.id from users u where SUBSTRING(u.customproperty10,1,7)=SUBSTRING(u.customproperty11,1,7) AND u.id = 'userkey').size()==1)
03/12/2024 08:21 PM - edited 04/03/2024 06:28 PM
Hi @NM ,
Please find the attached log.
03/12/2024 08:34 PM
Hi @janice , As per the workflow screenshot missing a closing bracket at the end.
03/12/2024 09:35 PM - edited 04/03/2024 06:28 PM
Hi @NM @rushikeshvartak ,
I have updated the workflow but still the same. Here's the log and the screenshot of workflow
03/12/2024 09:49 PM - edited 03/12/2024 09:51 PM
(com.saviynt.ecm.identitywarehouse.domain.Usergroup_users.executeQuery("select u.id from Users u where SUBSTRING(u.customproperty10,1,7)=SUBSTRING(u.customproperty11,1,7) AND u.id = 'userkey').size()==1)
03/13/2024 12:02 AM - edited 04/03/2024 06:29 PM
Thanks for the query. This query is working for self-request, however when we perform "Request Access for Others", it routes to admin. Here's the workflow screenshot and log.
03/13/2024 02:38 AM
Hi @janice., The above query will just determine whether cp10 and 11 are same or not if not it will flow to else block.. so even if cp10 or cp11 value is empty it will go to admin..
Can you share approval block ss as well...
03/13/2024 07:28 PM
Hi @NM ,
The id tested has value in both cp10 and cp11.
In the workflow, it is expected to route to different approver which is determined using custom query based on the substring of cp10 and cp11. Here's the screenshot of the workflow for your reference. It is working as expected for self request, however when "Request Access for Others", it routes to admin regardless the ifelse returns true or false.
03/13/2024 07:41 PM
Please help me with below results to help further
Requestor | End user | Requestor Cp10 | Requestor Cp11 | End User Cp10 | End User Cp11 | Expected Flow | Current Flow |
rushi | rushi | ||||||
03/13/2024 07:57 PM
Please find my response below:
Requestor | End user | Requestor Cp10 | Requestor Cp11 | End User Cp10 | End User Cp11 | Expected Flow | Current Flow |
rushi | rushi | 12345678 | 12345678 | 12345678 | 12345678 | approver1 | approver1 |
rushi | rushi | 12345678 | 11112222 | 12345678 | 11112222 | approver2 | approver2 |
rushi | janice | 12345678 | 12345678 | 12345678 | 12345678 | approver1 | admin |
rushi | janice | 12345678 | 12345678 | 12345678 | 11112222 | approver2 | admin |
The third and fourth rows are the scenario where rushi submit request access for janice. Hence, the query should check janice's cp10 and cp11 to determine the approver.
03/14/2024 11:51 PM
Hi @rushikeshvartak ,
May I know if you have any advise on this? Thanks in advanced.
03/17/2024 07:07 PM
This is expected behaviour when requestor = Approver request will be assigned to admin
03/17/2024 07:15 PM
Thanks for your response.
The approvers are another ID we created, hence the requestor is not equal to approver in the case when it routes to admin.
03/17/2024 08:12 PM
Please share current workflow screenshot