Skip to main content
I have a schedule defined with two layers, each a week in length. Each of the layers defines a 12 hour shift, one for US based people and the other for India based people. For the US based layer I want to create an override for the entire week that just replaces the US based person and not the India one. In other words, a different person will take the US shift for the entire week, but the India person will remain unchanged. How do I do this without having to schedule an override for each 12 hour shift of the US person?

Hi Clara,


I can only think of ways to do this via API. The approach I was able to come up with was to first use GET /schedules/{id} on the schedule and then generate overrides based on entries of the “rendered_schedule_entries” property inside of the “final_schedule” property, which lists entries of the schedule. Note that to constrain the entries to the desired week, you will need to use the “since” and “until” query parameters when making this initial request.

 

It is also possible to use the “rendered_schedule_entries” property of the desired layer within the “layers” property (each entry has a “Name” property that can be used to identify it), but if the need is to target a user for overrides, using “final_schedule” is the more reliable approach because it will take into account preexisting schedule overrides and superseding schedule layers that can add or remove shifts of that user. Moreover, using “final_schedule” is idempotent; if there are no schedule entries after creating overrides the first time, no new overrides will be created because the user will have no shifts in the schedule for the given time range.

 

After getting the schedule entries, take each entry matching the user’s ID from that list and use it to compose a list of overrides. That can then be used to create the overrides via POST /schedules/{id}/overrides. Each override in the list is an object as follows:

  • The “start” and “end” property map to the original schedule entry 
  • The “user” property should be a resource reference (an object with “id” and “type” properties) specifying the user to be on-call for the override

Reply