Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

auto approve request when resource owner is requester or requestee

NM
Honored Contributor III
Honored Contributor III

Hi Team,

As per the use case we have to approve the request if it is submitted by endpoint resource owner or submitted for endpoint resource owner

Tried these, didn't work, any other variable which can be used?

endpoints.resourceowner eq requestedby.username

endpoints.requestowner eq requestedby.id

endpoints.requestowner eq user.id

Thanks


If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'
24 REPLIES 24

Kaustubh
Regular Contributor
Regular Contributor

 

IF ELSE Component

Condition: (com.saviynt.ecm.identitywarehouse.domain.Usergroup_users.executeQuery("select ugu.id from Usergroup_users ugu where ugu.user_groupkey = '${endpoints?.requestowner}' AND ugu.userkey= '${requestedby?.id}'")?.size() != 0)

Expression Language: groovy

 

Please try above when you are mapping resource owner.


Kaustubh Pawar
Saviynt Certified IGA Professional

NM
Honored Contributor III
Honored Contributor III

Hi @Kaustubh , I tried this 

(com.saviynt.ecm.identitywarehouse.domain.Endpoints.executeQuery("select e.requestowner from endpoints e where e.endpointname = '${endpoints.endpointname}' AND e.requestowner= '${requestedby?.id}'")?.size() != 0)

i am getting an error "Cannot get property endpointname on null object"

 


If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'

(com.saviynt.ecm.identitywarehouse.domain.Endpoints.executeQuery("select e.requestowner from endpoints e where e.endpointkey= '${endpoint}' AND e.requestowner= '${requestedby?.id}'")?.size() != 0)


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

NM
Honored Contributor III
Honored Contributor III

@rushikeshvartak @Kaustubh , I hardcoded the endpoint key but received script evaluation error

script evaluation error: javax.script.ScriptException: org.springframework.orm.hibernate3.HibernateQueryException: unexpected token: ( near line 1, column 41 [select e.requestowner from endpoints.get(requestaccesskey) e where e.endpointkey= 5 AND e.requestowner= 336 ]


If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'

Kaustubh
Regular Contributor
Regular Contributor

Please share WF screenshot and make sure to map resource owner under endpoint.


Kaustubh Pawar
Saviynt Certified IGA Professional

NM
Honored Contributor III
Honored Contributor III

Hi @Kaustubh @rushikeshvartak 

Here is the workflow screenshot.. quite basic

 

NM_1-1721625195954.png

 

Type - Parallel


If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'

Kaustubh
Regular Contributor
Regular Contributor

Working for me.

selected Resource owner group at endpoint.

Kaustubh_2-1721626691777.png

 

Kaustubh_1-1721626630324.png

 

Kaustubh_3-1721626785154.png

 

 


Kaustubh Pawar
Saviynt Certified IGA Professional

NM
Honored Contributor III
Honored Contributor III

Hi @Kaustubh , we have a single user instead of user group that is where it is not working.

@Kaustubh , it is bit urgent for us.. if you can help out with only single user.


If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'

Kaustubh
Regular Contributor
Regular Contributor

Trying... Couldn't figure out for single user as of now. As it is urgent, create a user group and follow the steps for now.

If solution works, accept as solution.


Kaustubh Pawar
Saviynt Certified IGA Professional

Share query


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

I tried the query shared by you. I get result in data analyzer but cannot submit the access request.

(com.saviynt.ecm.identitywarehouse.domain.Endpoints.executeQuery("select e.requestowner from endpoints e where e.endpointkey= 1167 AND e.requestowner= '${requestedby?.id}'")?.size() != 0)

(com.saviynt.ecm.identitywarehouse.domain.Endpoints.executeQuery("select e.requestowner from endpoints e where e.endpointkey= '${endpoint}' AND e.requestowner= '${requestedby?.id}'")?.size() != 0)


Kaustubh Pawar
Saviynt Certified IGA Professional

Did you validated logs ?


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

What should I look for in the logs?
Here's what I thought might be helpful:

Kaustubh_0-1721787921294.png

 


Kaustubh Pawar
Saviynt Certified IGA Professional

This are unwanted error. Logs when request id raised or where you added block


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Using query in if-else block:

(com.saviynt.ecm.identitywarehouse.domain.Endpoints.executeQuery("select e.requestowner from endpoints e where e.endpointkey= '${endpoints}' AND e.requestowner= '${requestedby?.id}'")?.size() != 0)

 

It is fetching endpoint name and trying to match with endpoint key.

2024-07-24T03:11:50.552273732Z stdout F org.jbpm.api.JbpmException: script evaluation error: javax.script.ScriptException: org.springframework.orm.hibernate3.HibernateQueryException: unexpected token: ( near line 1, column 41 [select e.requestowner from endpoints.get(requestaccesskey) e where e.endpointkey= 'Matillion' AND e.requestowner= '977']; nested exception is org.hibernate.hql.ast.QuerySyntaxException: unexpected token: ( near line 1, column 41 [select e.requestowner from endpoints.get(requestaccesskey) e where e.endpointkey= 'Matillion' AND e.requestowner= '977']


Kaustubh Pawar
Saviynt Certified IGA Professional

Use below logic

(com.saviynt.ecm.identitywarehouse.domain.Endpoints.executeQuery("select e.requestowner from Endpoints e where e.endpointname= '${endpoints}' AND e.requestowner= '${requestedby?.id}'")?.size() != 0)

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

@NM  Is this issue resolved ?


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

NM
Honored Contributor III
Honored Contributor III

Hi @rushikeshvartak , I tried with endpoints in groovy language it wasn't working .. so went ahead with custom assignment


If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'

Please share query


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Dave
Community Manager
Community Manager

Hello @NM - Sharing the actual solution here will help others who are experiencing a similar situation. 

Thank you,
Dave

@NM  Can you please share SQL query used to help other facing same issue in future


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

NM
Honored Contributor III
Honored Contributor III

Hi @rushikeshvartak , after developing the solution half way.. our requirement was changed entirely .. I am working on the approval process ... I will share once it is completed.


If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'

NM
Honored Contributor III
Honored Contributor III

Hi @rushikeshvartak , got the same error

i am getting an error "Cannot get property endpoint on null object"


If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'

Hi @NM use the below Query. This is working for me in 24.4 if the request is raised by the resource owner or if its requested for resource owner. Let me know the outcome!

(com.saviynt.ecm.identitywarehouse.domain.Endpoints.executeQuery("select e.requestowner from Endpoints e where e.endpointname = '${endpoints.endpointname}' AND (e.requestowner= '${requestedby?.id}' OR e.requestowner='${user.id}')")?.size() != 0)

 

Regards,
Naveen Sakleshpur
If this reply answered your question, please click the Accept As Solution button to help future users who may have a similar problem.