We have a text field we would like to be populated on resolve/close but only when the resolution is fixed, complete, or cannot reproduce. Is this possible?
you could create 2 transitions:
And use 2 diferent transition screens and validators.
Thanks, but that's really not what we're looking for. We need a validator that incorporates conditional logic.
This is a script for simple script validator:
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.fields.CustomField switch (issue?.getResolutionObject().getName()){ case "fixed": case "complete": case "cannot reproduce": CustomField textField = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("field name") return issue?.getCustomFieldValue(textField) != null; default: return true; }
For the transitions that go to the Resolved status (or whatever name you use for that status), you need to have a screen that includes the fields you want to validate and any other fields that you want to allow the agents to edit during the transition.
Using a Validator in the workflow will not put the "required field" asterisk next to those fields, but you can provide a message that will display if the validation fails. You can check each required field in a separate validator, or combine multiple fields in a single validator. The validators will be gone through in order, but only one validator's message will display. If there are multiple missing required fields, only the message for the first missing required field will display.
It looks like you're new here. Sign in or register to get started.