Create Project with Project Template times out

I created a project template in my app. My projects shall use a specific set of configuration schemes which I wanted to create programmatically inside of my configure()-method in my AddProjectHook class. I tried to create issuetypes, fieldscreens, fieldschreenschemes, workflows and a workflowscheme, if they are not already existing. Unfortunately the creation process at runtime times out without any visible cause in the logs. It just says “Request timeout when creating project” in the GUI.

I am not using the JSON config file for project templates because it seems not to be possible to reuse existing schemes here. Everytime I create a project with my template it creates a new workflowscheme, workflows, fieldscreens and fieldscreenschemes. Only the issuetypes were not dublicated.

Is it generally a good idea to create these things during project creation or should I move it somewhere else? Is there a way to increate the timeout threshold?

regards,
Jens

I create the entities on plugin-install. My hook then has ‘findOrCreate’ methods. So in a best case scenario, it will find the entities like schemes or types I need. Only if they have been deleted by an admin will I have to create them.

This approach has worked well for me.

Turned out that there as an exceptions hidden when I run my code. The result looked like a timeout, but it was not one.

I switched to your approach (getOrCreate) too. I create all schemes, etc. after the PluginEnabledEvent (to avoid some problems with initialization) and in the configure() method of the AddProjectHook class I only assign the already created to my project.