Modify or create a new workflow.
Add a new validator.
Most of the built-in workflow functions can be customized with Condition code or Additional actions code, so if you can use a built-in script, you should.
Example 1. Where to put your scripts?
For each type of workflow function, the plugin will provide the current
transientVars in the script binding. That means you can refer to them using these variables, without declaring them.
If you use Intellij IDEA, you can add a dynamic property for these variables of the correct type. Alternatively you can just redeclare it with type information:
import com.atlassian.jira.issue.Issue; Issue issue = issue
To disallow the transition you throw a new
This has constructors for specifying a general error message, and for applying an error message to a particular field. For example, to set the resolution field in error:
To apply a general error message:
Instead of a custom validator you may prefer to use Simple Scripted Validator, which has a UI where you specify what field to apply the error message to.