I have a Single Select List Custom Field called "Test Request Type" Options include Level, Character, and Weapon.
When Creating a "Test Request" issue type (on the Create screen), I would like to dynamically change the Description field based on the user's form selection of the Test Request Type field.
To accomplish this, I have tried using Scriptrunner Behaviors.
The code block below is a serverside script attached to the Test Request Type field, but I can't get the Description field to update dynamically based on the user's choice.
Any help would be appreciated!
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.customfields.manager.OptionsManager
import com.atlassian.jira.issue.customfields.option.Options
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.onresolve.jira.groovy.user.FormField
import groovy.transform.BaseScript
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.CustomFieldManager
FormField testRequestType = getFieldByName("Test Request Type")
def stringValue = testRequestType.getValue() as String
if (stringValue == "Level")
{
def desc = getFieldById("description")
def defaultValue = """h2. How to reproduce
* step 1
* step 2
h2. Expected Result
The widget should appear
h2. Actual Result
The widget doesn't appear""".replaceAll(/ /, '')
desc.setFormValue(defaultValue)
}