We use custom validators that are repeated on various tranisitions in the JIRA workflow. Therefore I'd like to add our scriptrunner validator to built-in validator scripts.
I came across an example for listeners but would like to know how it can be done for Validator.
example for listener:
@ScriptListener
class SampleScriptListener implements CannedScript {
public static String FIELD_MY_PARAM = "FIELD_MY_PARAM"
@Override
String getName() {
"Sample listener"
}
@Override
String getDescription() {
"Sample listener from a plugin"
}
@Override
List getCategories() {
[] // unused
}
example for validator (doesn't work):
class MyFirstValidator implements CannedScript {
public static String FIELD_MY_PARAM = "FIELD_MY_PARAM"
@Override
String getName() {
"My Validator"
}
@Override
String getDescription() {
"Sample listener from a plugin"
}
@Override
List getCategories() {
["Validator"] // unused
} Is there an annotation that I need to use for validator? Do you have an example I could use?