Hello,
I want to show/Hide a field(multi line text box) based on option selected in multi select field. I am using the below code but this only hides the "multi line text box" but never shows-
////////////
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
import com.atlassian.jira.component.ComponentAccessor
@BaseScript FieldBehaviours behaviours
def reasonForBlock = getFieldById("customfield_11842") //
def flaggedField = getFieldById("customfield_11829") //
def selectedOption = flaggedField.getValue() as String
log.debug "Selected option: $selectedOption"
if (selectedOption.toString().contains("Other")){
reasonForBlock.setHidden(false)
}
else {
if(reasonForBlock.value)
{
reasonForBlock.setFormValue(null)
}
reasonForBlock.setHidden(true)
}
Can someone help?
Regards,
Priyanka
Samo here. Is there a way to create a constants file/class and invoke those constants across the scripts? Both ones saved on the server and ones written in inline scripts in Jira?
Cheers,
Marina
I'm looking for a same solution to have more transparence over general variables we use in groovy scripts (e.g. in post-function or Listener or Behavior). Any luck with a solution?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.