import com.almworks.jira.structure.api.permissions.PermissionLevel
import com.almworks.jira.structure.api.StructureComponents
import com.onresolve.scriptrunner.runner.customisers.PluginModule
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
@WithPlugin("com.almworks.jira.structure")
@PluginModule
StructureComponents structureComponents
// the name of the new structure
final String structureName = "YOUR_STRUCTURE_NAME"
def structureManager = structureComponents.structureManager
// if structure with the given name doesn't exist, create a new empty one
if (!structureManager.getStructuresByName(structureName, PermissionLevel.ADMIN)) {
structureManager.createStructure().setName(structureName).saveChanges()
}