Hello community,
Due to a reported vulnerability in Atlassian, we have upgraded our Jira instance to version 9.12.22 and updated all our add-ons, including ScriptRunner. However, after the upgrade, we noticed the following Behaviour scripts for service management stopped working. Other scripts for Service Management also stopped working due to this issue. I had to turn off the below script for the other script to work. It doesn't show any error, and I am unable to find a fix. Can someone please help? Thanks.
import com.atlassian.jira.config.IssueTypeManager
import com.atlassian.servicedesk.api.requesttype.RequestTypeService
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.bc.project.component.ProjectComponent
Map exclusiveComponentByRequestType = [
"Technical Support ": ["Software","Hardware","Accounts"]
]
if (!requestTypeName) {
return
}
def validComponents = issueContext.projectObject.components
if (exclusiveComponentByRequestType.containsKey(requestTypeName)) {
def validComponentNames = exclusiveComponentByRequestType[requestTypeName]
validComponents = validComponents.findAll { it.name in validComponentNames }
} else {
exclusiveComponentByRequestType.each{rtName, componentNames->
if(rtName != requestTypeName){
validComponents.removeAll { it.name in componentNames }
}
}
}
getFieldById("components").setFieldOptions(validComponents)