Skip to main content
Skip table of contents

Delete Archived Structures



package examples.docs.structure
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
def structureManager = structureComponents.getStructureManager()
def permission = PermissionLevel.valueOf("ADMIN")
def structures = structureManager.getArchivedStructures(permission)
structures.each { st ->
    structureManager.deleteStructure(st.getId())
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.