Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to set default epic link using Behavior

Brian Taylor
Contributor
December 11, 2017

I have a behavior that is not working - 

 

// Behavior Server Side Script

import com.atlassian.jira.component.ComponentAccessor

if (getActionName() == "Create") {
return // not the initial action, so don't set default values
}

// set a select list value
def ProgramFld = getFieldByName("Epic Link")
def optionsManager = ComponentAccessor.getOptionsManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def customField = customFieldManager.getCustomFieldObject(ProgramFld.getFieldId())
def config = customField.getRelevantConfig(getIssueContext())
def options = optionsManager.getOptions(config)
def optionToSelect = options.find { it.value == "PRDRPTD-1" }
ProgramFld.setFormValue(optionToSelect.optionId)

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events