I have code that sets the default value for resolution and works fine in the the first option becomes the default.
Is there a way to have the default option = "Please Select" then the defined values
import com.atlassian.jira.component.ComponentAccessor
import static com.atlassian.jira.issue.IssueFieldConstants.RESOLUTION
if (getActionName() == "Accepted") {
def constantsManager = ComponentAccessor.constantsManager
def allowedResolutions = constantsManager.resolutions.findAll {
it.name in ["Done", "Future Release", "Live"]
}
getFieldById(RESOLUTION).setFieldOptions(allowedResolutions)
}
else {if (getActionName() == "Completed") {
def constantsManager = ComponentAccessor.constantsManager
def allowedResolutions = constantsManager.resolutions.findAll {
it.name in ["Done", "Future Release", "Live"]
}
getFieldById(RESOLUTION).setFieldOptions(allowedResolutions)
}}