Forums

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

possibility to configure custom field default value based on issue type and project ?

Renni Verho
Contributor
September 28, 2018

Is there possibility to configure different default values and Options for custom field based on issue types inside one project ? 

example : 

projects x,y and z in Jira

Y and Z uses Custom field default configuration for all issue types. 

In project x settings: 

- if issue type is Support then work type is support or other

- if issue type not Support work type cf value can be Design, development or other - default development.

I tried to do settings via "Configure Custom Field:" , but project is possible to select only once for settings (= only one setting/project) . 

 

 

 

2 answers

1 accepted

1 vote
Answer accepted
Renni Verho
Contributor
October 1, 2018

After searching found request to add functionality https://jira.atlassian.com/browse/JRASERVER-6851, but it is in Not being considered status. 

I found solution/workaround by using Jira script runner Behaviour and script : 

import com.atlassian.jira.component.ComponentAccessor

def FieldName = getFieldByName("<customfield name>")
def optionsManager = ComponentAccessor.getOptionsManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def customField = customFieldManager.getCustomFieldObject(FieldName.getFieldId())
def config = customField.getRelevantConfig(getIssueContext())
def options = optionsManager.getOptions(config)
def optionToSelect = options.find { it.value == "<selection>" }
FieldName.setFormValue(optionToSelect.optionId)

 

Mapping scripts to project issuetypes default values can be set. 

1 vote
Irfan Mazli Mazuki
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 1, 2018

Hello @Renni Verho,

Indeed it seems it is a limitation in the default JIRA where the Custom Field context can only be configured for once per project. So it would seem that it is not possible to set multiple context for each projects in the default JIRA :(

Suggest an answer

Log in or Sign up to answer