I've got a Custom script validator that is testing multiple fields prior to transitioning the issue. If a field fails validation I append error text to a string that I throw as a InvalidInputException if the string is not empty. However, the error that the users sees does not have line breaks. All the error messages are just lumped together. Is there a way to do this, or maybe I'm just doing this wrong? Thanks.
def errorText = "";
if(a != b) {
errorText += 'A did not equal B.\n';
}
if(C != D) {
errorText += 'D did not equal C.\n';
}
if (errorText != "") {
throw new InvalidInputException(errorText)
}