Api method getAssociatedIssueTypes() returning null objects

Amine May 3, 2021

Hello,

I want to retrieve with scriptrunner all IssueTypeSchemes and their related Issuetypes, 

When i call the method getAssociatedIssueTypes() to retrieve the issuetypes linked to a FieldConfigScheme i get always a collection of null objects. 

Below the script : ( for exemple extracting all issutypes of Default ITS)


import com.atlassian.jira.component.ComponentAccessor

def issueTypeSchemeManager = ComponentAccessor.getIssueTypeSchemeManager()


def defaultIssueTypeScheme = issueTypeSchemeManager.getDefaultIssueTypeScheme()

defaultIssueTypeScheme.getAssociatedIssueTypes()

 

Result :

[null]

 

Any idea to fix that , thank you in advance !

1 answer

1 vote
Peter-Dave Sheehan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 3, 2021

There seem to be some methods in the FieldConfigScheme that no longer work ... but I get get the desired results from the manager:

import com.atlassian.jira.component.ComponentAccessor

def issueTypeSchemeManager = ComponentAccessor.getIssueTypeSchemeManager()
def projectKey = 'JSP'
def project = ComponentAccessor.projectManager.getProjectByCurrentKey(projectKey )
def defaultIssueTypeScheme = issueTypeSchemeManager.getDefaultIssueTypeScheme()

log.info "default scheme issue types: ${issueTypeSchemeManager.getIssueTypesForDefaultScheme()*.name}"
def scheme = issueTypeSchemeManager.getConfigScheme(project)
log.info "$projectKey Project issue types: ${issueTypeSchemeManager.getIssueTypesForScheme(scheme)*.name}"

Suggest an answer

Log in or Sign up to answer