I have now upgraded successfully to 1.17 with PHP 8.1.11 (on Windows) and configured the IMAP with OAuth2 for Mailfetching from Office 365.
Everything looks ok, no error messages etc but it does not fetch emails.
In Azure AD sign-in logs I dont see any failed login attemtps. The only login from osticket account is when the app registration was approved.
Im not really sure where I should start look to troubleshot this. It seems like osTicket is not even trying to logon with IMAP.