Exclude Weekends and Holidays for Calculate TTR

Niranjan2
Tera Contributor

Hi,
Iam looking to create a Report which track Time to Resolve Tickets, for this I'm in the process of configuring an Action in flow designer, we already have an action available which calculate the TTR. Looking to exclude Weekends and Hoildays for that. having issue in coding part within the Action. Any help is appreciated.
Attached the current script.

 

 

 

@Ankur Bawiskar @Jaspal Singh 

14 REPLIES 14

Hi @Rajesh_Bhise Thanks for the solution, it is throwing a error "Error: Java constructor for "com.glide.glideobject.GlideDate" with arguments "string" not found." when i Test above script in flow action. 

Hello @Niranjan2 ,

 

You can change your inputs type to Date instead of string.

e.g. inputs.Created       this should be date type field.

 

Hi @Rajesh_Bhise 

 

Even though i have changed the Inputs type to Date Instead of Date/Time, it is still showing the same error.

 

Try Duration calculator, two examples of using 

calcScheduleDuration(GlideDateTime startTime, GlideDateTime endTime)

and

calcScheduleDuration(String startTime, String endTime)

 

Here:

DurationCalculatorAPI

 

Use the cmn_schedule for "8-5 weekdays excluding holidays" record's sys_id. If you don't care about business days, create a new schedule like "8-5 weekdays excluding holidays" with days and hours set the way you want.

Community Alums
Not applicable

Hi @Niranjan2 ,

Please check below solved community link may be this will help you 

https://www.servicenow.com/community/developer-forum/calculate-business-day-difference-between-two-d...

 Also check this post 

https://www.servicenow.com/community/itsm-articles/calculate-working-days-using-schedule/ta-p/230047...

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards 

Sarthak