There is a custom select list field, where we would like the list of options to be different depending on the issue type, within a project.
No worries setting up a custom field configuration scheme for the first issue type.
However Jira is not letting us define a other scheme for the same project again.
So are we stuck with only having one set of options, per custom field, per project?
I'd rather not create many custom fields for this, nor have one option list with alllll of the options (which don't make sense on the wrong issue type), and we cannot use the default scheme because of its global presence.
Thanks everyone!
This could be possible with script runner behaviour. You can write this behaviour for issue type
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
def selectFieldName = "custom field name"
def issuetype = getIssueContext().getIssueType().name
def selectField = getFieldByName(selectFieldName)
// Getting select field options
def selectCustomField = customFieldManager.customFieldObjects.findByName(selectFieldName)
def selectConfig = selectCustomField.getRelevantConfig(issueContext)
def selectOptions = ComponentAccessor.optionsManager.getOptions(selectConfig)
if(issuetype.contains("story")) {
selectField.setFieldOptions(selectOptions.findAll { it.value in ['option1','option2'])
} else if(issuetype.contains("bug")) {
selectField.setFieldOptions(selectOptions.findAll { it.value in ['option3','option4'])
}
Thank you @Gokaraju gopi I believe that will work (and we do have ScriptRunner) and will give it a whirl on Monday.
I'm just (continually) confused / disappointed that's it's not something more natively supported in Jira, since embedding data in scripts is bad practice and not transparent.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Discover how Atlassian is revolutionizing service management with cutting-edge solutions for AI-powered support, HR Service Management, or DevOps connectivity.
Register here ⬇️Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.