Hi Community,
Can you advice me on what's wrong with my code? it seems not to work when I want to change the value of Issue Type (e.g. Bug to Problem) using the value of single select field.
Here's my code:
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
@BaseScript FieldBehaviours fieldBehaviours
def regressionIssueField = getFieldById(getFieldChanged())
def regressedVersionField = getFieldByName("Issue Type")
String regressionIssueValue = regressionIssueField.getValue()
if (regressionIssueValue == "Sample") {
regressedVersionField.setFormValue("Service Request")
} else {
regressedVersionField.setFormValue("Service Request with Approvals")
}