Forums

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

How to change a project's Issue Type Scheme via Scriptrunner?

Jeremy Jedlicka July 20, 2023

I am attempting to move all archived projects to the default Issue Type Scheme but am having trouble.  Here is what I have so far:

 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.project.Project

def schemeManager = ComponentAccessor.issueTypeSchemeManager
def defaultScheme = schemeManager.defaultIssueTypeScheme

def plist = []

//This section sets all archived projects to the Default Scheme

ComponentAccessor.getProjectManager().getArchivedProjects().each { it ->
plist += it.getKey()
}

for(item in plist){
    def project = ComponentAccessor.getProjectManager().getProjectObjByKey(item)
    def oldScheme = ComponentAccessor.getIssueTypeSchemeManager().getConfigScheme(project)
    def oldId = ComponentAccessor.getIssueTypeSchemeManager().getConfigScheme(project).getId()



}

 

I have the code grabbing the right projects and the right scheme.  I just can't find a method to remove the scheme.

This is a simple task for Issue Type Screen Schemes, but not for Issue Type Schemes.

Any help would be appreciated!

 

1 answer

0 votes
Kian Stack Mumo Systems
Community Champion
July 20, 2023

@Jeremy Jedlicka

 

Have you reviewed this thread? It's a bit out of date, but it is trying to do pretty much what you are trying to do.

 

Thanks,

 

Kian

Suggest an answer

Log in or Sign up to answer