Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,366,304
Community Members
 
Community Events
168
Community Groups

Setting Default Resolution value

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

Atlassian Community Events