Calculating a working time delay

 In this tutorial, we will see how to add an amount of working hours to a given date and time.


Use Case

A support team guarantees a maximum response time resolution for its customers:

60 hours for a minor incident, 15 hours for a major incident, 8 hours for a critical incident.

In accordance with the contract, this period is expressed in team’s working hours.

The team works every day from Monday to Friday from 9 a.m. to 1 p.m. then from 2 p.m. to 6 p.m.

Based in London, England, the team does not work on national public holidays except for Good Friday which is worked.

The team will integrate the working days API into its incident management tool in order to automate the delay calculation.


Tutorial

First let’s go to www.work-day.co.uk and log in (any email can be used)


Select the relevant public holidays and rename the profile (for instance SLA1)


Setup the week time schedule of the team


Now the calendar is fully configured, let’s copy the profile ID (a secret unique string that identifies this calendar)


When an incident occurs, this API call will instantly give the deadline: 

add_working_hours?country_code=GB&profile_id= D0FC8B&start_date=2022-05-24&start_time=14:37&increment_time=60:00  


and the JSON response:


{

"result":{

"end_date":"2022-06-07"

"end_time":"09:37"

}

}


Alternatively, adding any amount of working hours can be done from the working days website

 manually



Comments

Popular Posts