Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,360,219
Community Members
 
Community Events
168
Community Groups

These fields have default values for this project and issue type combination. We have preserved the

For a project behavior is mapped with initializer method to set the default value for cascading list. When the issue is created and values are selected for that field it works fine but when we edit the issue in the edit screen default values are set again but not the selected values for the field and message displayed like

These fields have default values for this project and issue type combination. We have preserved the existing values in case you need them.

Build product

1 answer

Hello @Shivakumar Hiremath ,

To my understanding, the initializer script will always run upon screen load. This means that it will overwrite any existing values that you have while editing.

Perhaps you can write a condition to check if the custom field is empty before setting the default value.

An example below:-

def description = getFieldById('description')
def descriptionValue = description.getValue()

def defaultText = "This is a default text."

if (descriptionValue.isEmpty()) {
description.setFormValue(defaultText)
}

Regards.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Online AMA this week: Your project management questions answered by Jira Design Lead James Rotanson

We know that great teams require amazing project management chops. It's no surprise that great teams who use Jira have strong project managers, effective workflows, and secrets that bring planning ...

189 views 1 6
Read article

Atlassian Community Events