Расширьте структуру, включив в нее все проблемы в эпической версии и включив все связанные проблемы - malikovalibek/groovyForJira GitHub Wiki

Обзор Структура для Jira позволяет создавать структуры для организации задач и проектов. Этот скрипт добавляет задачи в определенную структуру, включая все задачи, относящиеся к эпосу, или все задачи, связанные с определенными типами ссылок (например, «Блоки»).

пример Как менеджер проекта, я хочу добавить проблемы, связанные с эпосом, и все вопросы, связанные с проблемой, уже присутствующей в моей структуре. Я могу использовать этот сценарий для создания генератора расширений, который автоматически добавляет все проблемы, связанные с эпосом, или все проблемы, связанные с другой проблемой в структуре.

Хорошо знать Для этого скрипта требуется плагин Structure for Jira . import com.almworks.jira.structure.api.StructureComponents import com.almworks.jira.structure.api.forest.ForestSpec import com.almworks.jira.structure.api.forest.action.ForestAction import com.almworks.jira.structure.api.forest.item.ItemForestBuilderImpl import com.almworks.jira.structure.api.generator.CoreStructureGenerators import com.almworks.jira.structure.api.item.CoreIdentities import com.almworks.jira.structure.api.permissions.PermissionLevel import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.link.IssueLinkTypeManager import com.onresolve.scriptrunner.runner.customisers.PluginModule import com.onresolve.scriptrunner.runner.customisers.WithPlugin

@WithPlugin("com.almworks.jira.structure") @PluginModule StructureComponents structureComponents

def issueLinkTypeManager = ComponentAccessor.getComponent(IssueLinkTypeManager) def structureManager = structureComponents.structureManager def generatorManager = structureComponents.generatorManager

// Name of the structure you want to add this generator to final structureName = 'YOUR_STRUCTURE_NAME'

def structures = structureManager.getStructuresByName(structureName, PermissionLevel.ADMIN) assert !structures.isEmpty() : "No structure found with the name $structureName" def structureId = structures.first().id

def forestBuilder = new ItemForestBuilderImpl()

// Create the generator to extend the structure with the issues associated with the epics which were added to the structure def epicsExtenderItem = generatorManager.createGenerator(CoreStructureGenerators.EXTENDER_AGILE, [:], null) forestBuilder.nextRow(CoreIdentities.generator(epicsExtenderItem))

// Create the generator to extend the structure with the issues linked with other issues which were added to the structure // Change the issueLinkTypeName to what you need, in this case we are looking for the "Blocks" link type final issueLinkTypeName = 'Blocks' def blocksLinkTypeId = issueLinkTypeManager.getIssueLinkTypesByName(issueLinkTypeName).first().id

def params = [ 'linkTypeId' : blocksLinkTypeId, // Id of the 'Blocks' issue link type 'direction' : 'outward', // Direction of the link type, could be either 'inward' or 'outward' 'disableActions': false, // Enable structure actions 'from' : null, 'to' : 2 // Number of levels to extend issue at ] as Map def blocksExtenderItem = generatorManager.createGenerator(CoreStructureGenerators.EXTENDER_LINKS, params, structureId) forestBuilder.nextRow(CoreIdentities.generator(blocksExtenderItem))

def forestService = structureComponents.forestService def forestSource = forestService.getForestSource(ForestSpec.structure(structureId)) def forestToAdd = forestBuilder.build() forestSource.apply(new ForestAction.Add(forestToAdd, 0, 0, 0))