Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Setting Default Resolution value

Brian Taylor April 25, 2018

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)
}}

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events