We use OKTA to provision users (via Active Directory group) to our Jira and Confluence instance. When a new user is provisioned, OKTA creates the user and adds them to the jira-software-users and confluence-software-users groups. This is all well and good, but we have noticed that sometimes OKTA will receive an update to the user and will essentially reset the user and remove them from groups other than jira-software-users and confluence-software-users.
I was looking to create a custom listen in ScriptRunner to detect a the removal of the groups by the OKTA user and send an email.
Is this possible and would I be best to use the UserEditedEvent?