def Systemtype = getFieldById("customField_27600")
def Printer = getFieldByName("Printer/Scanner")
def other = getFieldByName("Other")
import com.atlassian.jira.component.ComponentAccessor
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def optionsManager = ComponentAccessor.getOptionsManager()
def corp = getFieldByName("customField_27524")
def customField = customFieldManager.getCustomFieldObject(Systemtype.getFieldId())
def config = customField.getRelevantConfig(getIssueContext())
def options = optionsManager.getOptions(config)
if(corp.getValue() == "Corp")
{
def optionsMap = options.findAll {
it.value in ["Laptop", "Desktop", "Wacom Tablet", "Printer/Scanner", "Other", "Desk Phone", "Mobile","Conf Phone" ]
}.collectEntries {
[
(it.optionId.toString()) : it.value
]
}
Systemtype.setFieldOptions(optionsMap)
}
else
{
def optionsMap = options.findAll {
it.value in ["PC", "Printer/Scanner", "Other", "Desk Phone", "iPad","PDA" ]
}.collectEntries {
[
(it.optionId.toString()) : it.value
]
}
Systemtype.setFieldOptions(optionsMap)
}
Whats wrong here ?
@Jacob francois , where are you hiding these options? on customer portal or on agent?
If on customer portal, mapped it to request type
If on agent , mapped it to issue type.
Hello @Jacob francois
Your code looks good and should work.
Where do you place it? It should be attached to a Corp field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am placing it in the script runner behavior on the Corp field.
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.