I have tried many of the examples for updating fields, but none of them seem to work.
I want to update any field based on another selected, in the portal form front end. Is this possible ? As the links below seem to mention how to do it, but it doesnt work practically
https://scriptrunner.adaptavist.com/latest/jira/behaviours-servicedesk.html
https://scriptrunner.adaptavist.com/latest/jira/recipes/behaviours/select-list-other.html
---------
def desc = getFieldById("description")
def regressionIssueField = getFieldById(getFieldChanged())
if (regressionIssueField == "priority") {
desc.setFormValue("defaultValue")
}
---------------
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.onresolve.jira.groovy.user.FormField
import groovy.transform.BaseScript
import com.atlassian.jira.config.PriorityManager
import com.atlassian.jira.issue.priority.Priority
@BaseScript FieldBehaviours fieldBehaviours
if ((getFieldById(getFieldChanged()).value as Priority)?.name == "High") {
getFieldById("description")
.setLabel("Why do you need this and why so important?")
.setDescription("Please explain why this is Highest priority including details of outage etc.")
}
else {
getFieldById("description")
.setLabel("Why do you need this?")
.setDescription("Tell us why you want this.")
}