What I would like to do:
On a workflow transition screen, expose Issue Links only if the Resolution selected is "Duplicate".
I've been trying to do this with a ScriptRunner Behaviour on the Resolution field. What I have right now hides the Issue Links fields on the correct screen, but it doesn't show them on the Resolution selection.
I don't have a background in Groovy/Java and cobbled this together from googling, so this might be something basic? It's not throwing any errors or warnings when I set up the Behaviour.
What isn't working:
import groovy.transform.BaseScript
import com.onresolve.jira.groovy.user.FieldBehaviours
@BaseScript FieldBehaviours fieldBehaviours
def issueLinkType = getFieldById("issuelinks-linktype").setFormValue("duplicates")
def issueLinkValue = getFieldById("issuelinks-issues")
def resolutionValue = getFieldById(RESOLUTION).getValue()
final String screenName = 'Resolution and Assignee'
if (fieldScreen.name == screenName) {
if (resolutionValue == "Duplicate") {
issueLinkType.setHidden(false)
issueLinkValue.setHidden(false)
}
else {
issueLinkType.setHidden(true)
issueLinkValue.setHidden(true)
}
}