Hi There,
I have Created a Validator using Script Validator on Create transition to verify if the fixVersion has numeric values , block the cloning, sub-task creation since both are create events. Logic is working fine. I want to display user defined error instead of system error. When I am cloning a bug that has numeric fixVersion value I am getting the following error. I need to overwrite this error. Need help of how to overwrite this.
*********************************************
Clone issue: AS-XXXXX
admin errors exception
com.atlassian.jira.exception.CreateException.Error occurred
while creating issue through workflow
*********************************************
My code snippet
def origFixVer = issue.getFixVersions()
String origFixVersion = origFixVer[0]
def m = origFixVersion =~ /^(\d+)/
if( m ){
log.debug(String.format("User selected Numeric Versions for %s",issue.key))
log.warn(s1)
invalidInputException = new InvalidInputException("fixVersions", "Choose a better fix version")
}
You cannot override the System Validation error. Instead, your custom validation should work and throw Custom error message before the System Validator does. I have tried a similar validation for a custom field and the Custom exception is as follows.
invalidInputException = new InvalidInputException("Message")
This worked fine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.