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

Workflow- Access servers during office hours

Manju
New Contributor II
New Contributor II

Hi Team, 

Working on workflow to allow employees to create autoapprove request to access workloads during  office hours.  Office timing is from 8AM EST to 5PM EST.  Please share the variables  to be used in workflow condition. 

 

Thanks, 

Manju

6 REPLIES 6

Saathvik
All-Star
All-Star

Try to use this to get the system date and time when request generated compare with the range you looking for (try with or without groovy as expression language)

 

calendar.get(Calendar.HOUR_OF_DAY)>7 and calendar.get(Calendar.HOUR_OF_DAY)<18


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

Manju
New Contributor II
New Contributor II

Hi Team, 

Tried both the conditions in workflow.  Getting internal error while creating request. Looks like it is related to workflow condition

Manju_0-1679336966685.png

Manju_1-1679337022517.png

Regards, 
Manjunatha V

 

 

Can you check in logs if any additional information/logs is available on why it is failing and share it


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

Manju
New Contributor II
New Contributor II

Hi Saathvik, 

Below are the log details 

 

2023-03-21T02:27:14+05:30-arsms-{"log":"2023-03-20 20:57:13.543 ERROR [traceId=84dca025f1f28430, spanId=84dca025f1f28430, spanExportable=true, X-Span-Export=true, X-B3-SpanId=84dca025f1f28430, TENANT_ID=DEFAULT, X-B3-TraceId=84dca025f1f28430] 7 --- [http-nio-8787-exec-7] com.saviynt.ssm.arsms.util.ARSUtils : Request ID not generated. There was an error while processing the request \n","stream":"stdout","time":"2023-03-20T20:57:13.543312484Z"}
 
2023-03-21T02:27:14+05:30-arsms-{"log":"2023-03-20 20:57:13.548 ERROR [traceId=84dca025f1f28430, spanId=84dca025f1f28430, spanExportable=true, X-Span-Export=true, X-B3-SpanId=84dca025f1f28430, TENANT_ID=DEFAULT, X-B3-TraceId=84dca025f1f28430] 7 --- [http-nio-8787-exec-7] c.s.s.a.e.ControllerExceptionHandler : SERVER-ERROR|com.saviynt.ssm.arsms.exception.ServerException: ERROR.FROM.ECM.SERVER|\u0009at com.saviynt.ssm.arsms.util.ARSUtils.sendPostRequest(ARSUtils.java:1615) ~[classes!/:2021.1.0.0-SNAPSHOT]|\u0009at com.saviynt.ssm.arsms.jbpm.service.JbpmFlowService.requestAccessWorkFlow(JbpmFlowService.java:68) ~[classes!/:2021.1.0.0-SNAPSHOT]|\u0009at com.saviynt.ssm.arsms.service.impl.RequestAccessServiceImpl.createPrivilegedAccessRequest(RequestAccessServiceImpl.java:5627) ~[classes!/:2021.1.0.0-SNAPSHOT]|\u0009at com.saviynt.ssm.arsms.service.impl.RequestAccessServiceImpl.createRequest(RequestAccessServiceImpl.java:537) ~[classes!/:2021.1.0.0-SNAPSHOT]|\u0009at com.saviynt.ssm.arsms.controller.RequestAccessController.createRequest(RequestAccessController.java:81) ~[classes!/:2021.1.0.0-SNAPSHOT]|\u0009at com.saviynt.ssm.arsms.controller.RequestAccessController$$FastClassBySpringCGLIB$$e7fed2a1.invoke(\u003cgenerated\u003e) ~[classes!/:2021.1.0.0-SNAPSHOT]| \n","stream":"stdout","time":"2023-03-20T20:57:13.548581756Z"}
 
Regards, 
Manjunatha V



Hey try below, Also make sure if you need time/hour in different time zone please change highlighted section accordingly.

Calendar.getInstance(TimeZone.getTimeZone("EST5EDT")).get(Calendar.HOUR_OF_DAY)

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

Manju
New Contributor II
New Contributor II

Thanks Saathvik. It worked.  
To above condition now I am planning to add condition where only employee usergroup will be able to go for auto approval. Contract usergroup should go for manager approval.