Forums

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

How to create multiple configuration schemes within the same project?

Jon December 8, 2022

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!

1 answer

0 votes
Gokaraju gopi
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 8, 2022 edited

@Jon 

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'])

}

 

Jon December 9, 2022

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.

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, jira service management, jsm webinar, ai in jsm, opsgenie integration, incident management, virtual agent, atlassian intelligence, ai-powered service desk, it operations, atlassian learning, service management webinar, team '25 recap

What’s new in Jira Service Management 🤔

Discover how Atlassian is revolutionizing service management with cutting-edge solutions for AI-powered support, HR Service Management, or DevOps connectivity.

Register here ⬇️
AUG Leaders

Atlassian Community Events