Plugin works only after it is disabled and enabled again

Hi All,

We have developed some custom Jira plugin that adds a project mapping to scriptrunner behaviour for a specific custom field, when a Jira project is created. This is implemented via listener which is coded in our custom Jira plugin.

But recently, we have started noticing some issues when Jira projects are created. We are getting “Request Timed out error” upon project creation on the UI. On further analysis, we noticed that it is taking time for listener to execute which results in Request Timed Out error. From the logs it can be seen that thread execution is getting stuck when this listener is in execution.
As a workaround, we made the time consuming process of the listener as asynchronous so that the project creation process doesn’t wait for listener to complete its required job and proceeds with project creation. This has partially solved our issue but when we tried the project creation again, the error was still there. After further analysis, we found that the Jira project creation starts working fine if our custom Jira Plugin is disabled and then enabled again once.
If you have other suggestions for resolving this issue or any other workaround, it would be greatly appreciated.