Configure scripts to run at the start of your app (startup script) or at its end (shutdown script). The scripts are run every time because Power Scripts™ gets started / stopped, and this is usually either for administrative reasons (i.e. update of the app) or at Jira's own startup/shutdown.
You can configure both of them on the Administration → Manage Apps → Power Apps Config → Power Scripts → Lifecycle page.