Refactor the trigger attach so its not dependant on the intergration being already setup fixes #82495 & fixes #81999