You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.