Hi
How map components to a Request Type for a Service Desk project? We have many components for our Service Desk some are not valid for some Request Type. For example, technical support-related components are not valid for Sales. If customers select "Sales" Request Type it should only display "Purchase" and "Return". If Technical Support then it should display other components. I found a script it works fine with issue types but I don't know how to make it work with Request Type. I don't want to hide components from the backend, just from the customer portal.
import com.atlassian.jira.config.IssueTypeManager
import com.atlassian.jira.component.ComponentAccessor
Map validComponentNameByType = ["Task":
["Purchase","Return"]
] //Change Task issue type to "Sales" Request Type
def project = issueContext.projectObject
def issueType = issueContext.issueType.name
def component = getFieldById("components")
if(issueType && validComponentNameByType[issueType]){
def validComponent = project.getComponents().findAll{it.name in validComponentNameByType[issueType]}
component.setFieldOptions(validComponent)
}
I'll be thankful if someone helps me update the script for Request Type.
Thank you