Skip to main content
Skip table of contents

List Structures Owned by Inactive Users

CODE
import com.atlassian.jira.component.ComponentAccessor

def plugin = ComponentAccessor.pluginAccessor.getPlugin('com.almworks.jira.structure')
def loader = plugin.classLoader
def PermissionLevel = loader.loadClass('com.almworks.jira.structure.api.permissions.PermissionLevel')
def StructureAuth = loader.loadClass('com.almworks.jira.structure.api.auth.StructureAuth')
def structureComponents = plugin.getModuleDescriptor('structure-components').module
def structureManager = structureComponents.structureManager

StructureAuth.sudo {

   def activeStructures = structureManager.getAllStructures(PermissionLevel.NONE, false)
   def structuresToArchive = activeStructures.findAll { it.owner != null && !it.owner.isActive() }

   structuresToArchive
}

JavaScript errors detected

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

If this problem persists, please contact our support.