A question was posed to me from a user who would like to set up something where when a check box is made within a screen's fields, that another field becomes mandatory. Is this possible?
Hi @Matthew Knab ,
For that, you need to use a Field Required (JMWE app) Validator, select the required field, and add a "Conditional Validation" script like:
issue.customfield_12345.value == "Regression"
where customfield_12345 is the custom field ID of field Source. This easiest way to insert the right field ID is to use the "Issue Fields" help tab below the editor.
OR
If you have scriptrunner then you can add a behavior like this.
import com.onresolve.jira.groovy.user.FieldBehaviours import groovy.transform.BaseScript @BaseScript FieldBehaviours fieldBehaviours def regressionIssueField = getFieldById(getFieldChanged()) def regressedVersionField = getFieldByName("Regressed from Version") String regressionIssueValue = regressionIssueField.getValue() if (regressionIssueValue == "Yes") { regressedVersionField.setRequired(true) } else { regressedVersionField.setRequired(false) }
Thanks Manoj! Where would be the best spot to set this up, in the workflow or somewhere else?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The Field Required (JMWE app) Validator, you can use in your workflow.
For 2nd option, You have scriptrunner then go to the manage apps>>ScriptRunner>>Behavior>>Create a new behavior>> Create a mapping for the project and paste the script under initializer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And this would be setup as a Validator correct? I'm trying to find the best transition to attach it to. So far, I have tried to set it to a creation transition for a ticket, but it didn't seem to work.
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.