Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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
PD Sheehan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
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