I have a list of over 100 projects that are earmarked for archival and are the only projects in the applicable Issue Type Scheme. I'm trying to move these projects into a similar scheme that doesn't require any Issue mapping.
Trying to use Scriptrunner I'm attempting to use the method:
addProjectAssociations()
found in the documentation here: IssueTypeSchemeService (Atlassian JIRA - Server 8.0.0 API), but I keep getting a "groovy.lang.MissingMethodException: No signature of method:" error.
Any help would be appreciated.
Here is my code for reference:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.issuetype.IssueType
import com.atlassian.jira.project.Project
import org.apache.log4j.Category
def projectManager = ComponentAccessor.getProjectManager()
def issueTypeSchemeManager = ComponentAccessor.getIssueTypeSchemeManager()
def loggedInUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def Category log = Category.getInstance("")
log.setLevel(org.apache.log4j.Level.DEBUG)
def projects = "RDCALERTS"
def serviceOutcome = issueTypeSchemeManager.addProjectAssociations(loggedInUser, 21300, projects)
if (serviceOutcome.isValid()) {
log.info("Issue Scheme Updated")
} else {
log.error("Update failed: ${serviceOutcome.getErrorCollection().errors}")
}
Welcome to the Atlassian Community!
I think that's because you are passing a string into the call with "projects". The call is expecting a list (even if it is a list of one item!)
@Nic Brough -Adaptavist-
It doesn't seem to matter, I can use
def projects = ["ProjectID"]
and it will still give me an error.
It says the proposed solution is to:
Possible solutions: addProjectAssociations(com.atlassian.jira.issue.fields.config.FieldConfigScheme, java.util.Collection)
but this isn't a field configuration change, so Im not sure why it wants me to use that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is not an array or collection.
Try forcing the type by dropping down into Java, such as
String[] cars = {"Volvo", "BMW", "Ford", "Mazda"};
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.