I have a scriptrunner behavior that sets the values based on transition but want to have the default value "null" so that it says to select a value then have the values I have defined
import com.atlassian.jira.component.ComponentAccessor
import static com.atlassian.jira.issue.IssueFieldConstants.RESOLUTION
if (getActionName() == "Cancel Request") {
def constantsManager = ComponentAccessor.constantsManager
def allowedResolutions = constantsManager.resolutions.findAll {
it.name in ["Won't Do", "Duplicate", "Cannot Reproduce", "Cancelled", "Won't Fix", "Incomplete" ]
}
getFieldById(RESOLUTION).setFieldOptions(allowedResolutions)
}
Hello @Brian Taylor
First of all, you can do it without behaviour with jira properties on transiotion.
Check this article
If you need do it with behaviour you can try add null value in list
import com.atlassian.jira.component.ComponentAccessor
import static com.atlassian.jira.issue.IssueFieldConstants.RESOLUTION
if (getActionName() == "Cancel Request") {
def constantsManager = ComponentAccessor.constantsManager
def allowedResolutions = constantsManager.resolutions.findAll {
it.name in ["Won't Do", "Duplicate", "Cannot Reproduce", "Cancelled", "Won't Fix", "Incomplete", null]
}
getFieldById(RESOLUTION).setFieldOptions(allowedResolutions)
}
I appreciate the feedback and did think of using the properties as an option - but do not want to have to go to each workflow if a change is required
I tried adding null as suggested and it does not address the issue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I received confirmation from Adaptavist that Behaviors cannot have a Blank value in the behavior script - so the only way to limit the select is through the properties - thanks for the help
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.