No, because the order of validators does not matter.
Each validator is a simple yes or no question. If any one of them is a "no", the whole thing fails.
Think of baking a cake - you have validators like "do we have eggs", "do we have flour", and "do we have sugar" and "do we have butter". If any of them are "no", the transition from "gathering ingredients" to "making cake" fails. It is irrelevant what order you check for them.
I suspect your question is about a conditional flow of validation - if <something> = X, then check Y, but if <something> = Z, then do no further checks. Is that what you're trying to do?
I just want to have the same order as the fields in the screen. I can add a new field in the beginning of the screen but the new validation will be executed as the last one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just want to have the same order as the fields in the screen. I can add a new field in the beginning of the screen but the new validation will be executed as the last one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But the order does not matter. The only place you see the order is when you're an admin editing the workflow.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Assume you have many fields: first field, second field, third field.... When a user fills the form to create the issue and there are validation errors, he will have the alerts to fix the validation errors in the order that are the validations. So the validation for the 10th field may be before the validation of the first field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, that's a good reason for it, but JIRA doesn't think that way, it just fails all validation without order, because in most cases, it doesn't matter.
You could remove all the validators and re-add them in field order, but there is a better solution.
Write your own validation script to replace the set of canned ones you're using now. You can check every field you want to in one script, and return an error to the user listing all the fields they've missed or got wrong in one go. That's better for the user too - if they've made five mistakes, they don't have to correct them one at a time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do I have to use Custom script validator for my own validation script insted of Simple scripted validator ? Where can I find an example?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, that's correct.
The snippet I use as a base checks that a value is set if the issue type is bug:
if (issue.issueTypeObject.name == 'Bug' & cfValues['DemoSelectList']?.value == 'Capital'){
throw new InvalidInputException("Something to tell a user what went wrong")
return false
}
return true
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi again!
This is my snippet. I get an error for "InvalidInputException". Do I have to do some imports?
// Import Regex
import java.util.regex.*;
// Construct The Pattern to Match on
Pattern pattern = Pattern.compile("^([0-9]{1,6})\$");
// Check if the Order Number Field is a match
if (cfValues['Order Number'] == null || pattern.matcher(issue.getCustomFieldValue(customFieldManager.getCustomFieldObjectByName("Order Number")))){
throw new InvalidInputException("Please enter a valid number!")
return false
}
return true
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.