How to define auto-approved or not required approval in Workflow

Dalalsaleh888
New Contributor
New Contributor

I'm trying to build a WorkFlow for the service account. I started with if else condition and when the condition result is false, the request should get auto-approved. I utilized the available configuration called "Access Approval Not Required" but it seems it is not working as expected as it is asked for approver and approval type.

 

How to define auto-approved or not required approval in Workflow as a step in WF?

Dalalsaleh888_0-1690794578160.png

 

 

18 REPLIES 18

smitg
Regular Contributor III
Regular Contributor III

Hi @Dalalsaleh888 ,

Use Grant block to approve the request.

smitg_0-1690795230832.png

In your case map the 'false' of if else block  to 'Grant block'

Thanks,

Smitha

 

Thanks That Works. However, the other activity is not, below is the complete WF.

the account has an active owner but the WF directs it to Admin. 😞

Dalalsaleh888_0-1690886403462.png

 

 

smitg
Regular Contributor III
Regular Contributor III

Hi @Dalalsaleh888 ,

For user field 'AccountOwner' you need to pass the accountOwner's username in 'User group' field.
Since it takes hardcoded value better to use custom query to assign approval for account owners.

Select custom query in 'user field'
smitg_1-1690892015221.png
and try with below query
select ao.OWNERUSERKEY as userkey from accounts a,accountowners ao where a.accountkey=ao.accountkey and a.accountkey in (select distinct ra.accesskey from ars_requests ar, request_access ra WHERE ar.REQUESTKEY = ra.REQUESTKEY and ar.requestkey=${ARSREQUEST.id})

 

Thanks,
Smitha

 

Dalalsaleh888_0-1691331646042.png

It is still asking admin for approval.

Dalalsaleh888_1-1691331710060.png

 

Does query works in data analzyer after adding valid request key ?

Dalalsaleh888_0-1691395030499.png

 

pmahalle
Valued Contributor II
Valued Contributor II

Hi @Dalalsaleh888 ,

From above query, seems like you are using request id and request key. Use the query given by @smitg and try it in data analyzer with request key in place of ${ARSREQUEST.id}. You should get the userkey of the owner of the service account. You can get it in browser URL when you open specific request from request history/pending approval.

select ao.OWNERUSERKEY as userkey from accounts a,accountowners ao where a.accountkey=ao.accountkey and a.accountkey in (select distinct ra.accesskey from ars_requests ar, request_access ra WHERE ar.REQUESTKEY = ra.REQUESTKEY and ar.requestkey=${ARSREQUEST.id})


Regards,

Pandharinath Mahalle(Paddy)
If this reply answered your question, please Accept it As Solution to help others who may have a similar problem.

Hi Pamahalle,

The data analyzer shows the correct account owner but not sure why it is not working with the WF:

Dalalsaleh888_0-1691398393638.png

 

 

smitg
Regular Contributor III
Regular Contributor III

@Dalalsaleh888 is owner status is active in Saviynt?

Dalalsaleh888
New Contributor
New Contributor

Dalalsaleh888_0-1691405256832.pngDalalsaleh888_1-1691405280306.pngDalalsaleh888_2-1691405326352.png

Dalalsaleh888_3-1691405380651.png

 

Yes Active.

[Image edited by moderator to mask url]

pmahalle
Valued Contributor II
Valued Contributor II

Hi @Dalalsaleh888 ,

Can you try with below query once in workflow.

select userkey from users where FIND_IN_SET(users.userkey,(select distinct REPLACE(raa.attribute_value," ","")from request_access_attrs raa , ars_requests ar, request_access ra WHERE ar.REQUESTKEY = ra.REQUESTKEY and ra.REQUEST_ACCESSKEY = raa.REQUEST_ACCESS_KEY and ar.requestkey=${ARSREQUEST.id} and raa.ATTRIBUTE_NAME="USEROWNERKEY"))!=0


Regards,

Pandharinath Mahalle(Paddy)
If this reply answered your question, please Accept it As Solution to help others who may have a similar problem.

The WF is unable to be saved with the above query, and when I tryed to test it in Data Analyzer it shows this error:

Dalalsaleh888_0-1691406580803.png

 

pmahalle
Valued Contributor II
Valued Contributor II

@Dalalsaleh888 ,

Data Analyzed don't have access to few of the table but what's the error you are getting while saving workflow?


Regards,

Pandharinath Mahalle(Paddy)
If this reply answered your question, please Accept it As Solution to help others who may have a similar problem.

I see this below message and when I open the WF again I see the new query is not saved.

Dalalsaleh888_0-1691410791119.png

 

pmahalle
Valued Contributor II
Valued Contributor II

Hi @Dalalsaleh888 ,

Can you try to create new fresh workflow with above query and check.


Regards,

Pandharinath Mahalle(Paddy)
If this reply answered your question, please Accept it As Solution to help others who may have a similar problem.

it is the same it shows no info message:

Dalalsaleh888_0-1691581788010.png

 

smitg
Regular Contributor III
Regular Contributor III

Hi @Dalalsaleh888 ,

The query I provided earlier on this thread is working for me. 
Query : select ao.OWNERUSERKEY as userkey from accounts a,accountowners ao where a.accountkey=ao.accountkey and a.accountkey in (select distinct ra.accesskey from ars_requests ar, request_access ra WHERE ar.REQUESTKEY = ra.REQUESTKEY and ar.requestkey=${ARSREQUEST.id})
Workflow :

smitg_0-1691583981877.png

 

Please cross check on the account owner

Thanks,
Smitha

I tried the same what you have provided earlier and it didn't work. 

the owner is active.. please tell what else I need to check?