Created
August 27, 2014 19:24
-
-
Save jechlin/3197c7a9d6542ac3cf53 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FormField fixfield = getFieldById(getFieldChanged()) | |
def versions = fixfield.getValue() as List<Version> | |
// Make sure all versions consist of 2 '.' separated numeric fields. | |
// sometimes versions list can have a null in it... don't ask | |
versions.remove(null) | |
def badVersionNames = versions.findAll {! it.name.matches(/^\d+\.\d+$/)}*.name | |
if (badVersionNames) { | |
fixfield.setError("'Fix Version/s' must consist of 1 or more versions with 2 '.' separated numeric fields (ex: 14.1) " + badVersionNames + "}") | |
} | |
else { | |
fixfield.clearError() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment