Hello, It is technically possible but it might create a confusion. To be able to end a work period all tickets should be closed. Doing it automatically might create a confusion since it won't be able to end a work period if some tickets left open.
Maybe displaying a reminder message box at 11pm for ending the work period might be a better solution.