Morning & Afternoon shift in oncall
Asked by Patrick Robinson:

I'm trying to create a morning and an afternoon shift. They should not be handled by the same person ever. The night is taken by an actual oncall schedule which is separate and works fine and doesn't need changing in this context.

But the result for me is, that the shifts don't actually align at 50% each, but get this weird fragmentation pattern, even when making two distinct slots and a rotation of exactly the hours length of the slots (which already is annoying since for us it would actually be 4.5 hours each, but even at 5 hour each it still doesn't work).

The only way I have found to get rid of those, is to have two entire schedules again, but then the system doesn't give you any option I can find to ensure both schedules aren't given to the same person, if the same people are in the pool for both schedules, which for us they are.

Does anybody have an idea what else we could do to have two daytime shifts, each assigned to one person in its entirety and not the same person for both on one day?

Attached the failed schedule fragmentation and my attempted settings.

![Untitled.jpg](/t5/image/serverpage/image-id/259699iC3486AC25D9A0DB4/image-size/large?v=v2&px=999 "Untitled.jpg")

![SCR-20230526-jgpr.png](/t5/image/serverpage/image-id/259702i7718E4E716C95885/image-size/large?v=v2&px=999 "SCR-20230526-jgpr.png")


Answers:
author: John M
body: Hi [@Patrick Robinson](/t5/user/viewprofilepage/user-id/1687762) ,

There is a bit of a limitation with Opsgenie here, in that it builds the rotation out, and then adds time restrictions - so the restrictions don't come into play until after the shift length has been calculated.

In other words, the random shift lengths are caused by the gaps where there is no on-call user, but shift times are still calculated, which appears to throw off the visible time-restricted schedule. I have submitted the following bug for our development team to review:

<https://jira.atlassian.com/browse/OPSGENIE-1498>

The workaround would be to add the users on separate rotations.

comments: author: Patrick Robinson
body: As I said I tried separate rotations. With the same users in both, it virtually always scheduled both shift to the same person, which may never happen. That's the concept of having shifts.


author: Patrick Robinson
body: There is an answer in the ticket you mentioned. Summarizing for posterity:

If you set the rotation length to 6 hours and start at 7:00, you can setup the shifts as you desire, I assume as long as switchover is 13:00 or adjust start time if it isn't. The shifts don't need to be 6 hours for that.

<br />

![image-2023-06-01-10-09-59-630.png](https://jira.atlassian.com/secure/attachment/439180/image-2023-06-01-10-09-59-630.png)


author: John M
body: [@Patrick Robinson](/t5/user/viewprofilepage/user-id/1687762) Changing the start time is a good option, but it will only work if the shift length is divisible by 24, which is why the developer used a 6-hour shift in his solution. With a 5-hour shift, the shift lengths will not stay consistent since 5 does not divide evenly into 24.

Regarding the solution of using multiple shifts; you would need to add only one person to each shift. The only downside would be you would lose the 'escalate to next' option, which wouldn't matter if you're not using it.

![2023-06-01_10-45-01.png](https://community.atlassian.com/t5/image/serverpage/image-id/260818i5E754C7FA02A10B9/image-size/large?v=v2&px=999 "2023-06-01_10-45-01.png")


Tags: schedule