com.atlassian.jira.issue.IssueFieldConstants.ISSUE_TYPE
def field = getFieldById(ISSUE_TYPE)
field.setFieldOptions(['Bug', 'Task'])
Как можно подобно провернуть только с ограничением выбора sub-task ?
import com.atlassian.jira.component.ComponentAccessor def allowedSubTaskTypes = ["5"] // sub-task id def parent = getFieldById("parentIssueId") Long parentIssueId = parent.getFormValue() as Long if (parentIssueId && !underlyingIssue) { def issueManager = ComponentAccessor.getIssueManager() def parentIssue = issueManager.getIssueObject(parentIssueId) def parentIssueType = parentIssue.getIssueType().getName() def issueTypeSchemeManager = ComponentAccessor.getIssueTypeSchemeManager() def issueTypesForProject = issueTypeSchemeManager.getIssueTypesForProject(parentIssue.getProjectObject()) def allowedIssueTypes = issueTypesForProject.findAll { it.subTask && allowedSubTaskTypes.contains(it.id) } def issueTypeField = getFieldById("issuetype") issueTypeField.setFieldOptions(allowedIssueTypes) }
Обсуждают сегодня