The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Default Resolution value

Brian Taylor
Contributor
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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

TAGS
AUG Leaders

Atlassian Community Events