diff --git a/src/main/java/com/cwctravel/hudson/plugins/extended_choice_parameter/ExtendedChoiceParameterDefinition.java b/src/main/java/com/cwctravel/hudson/plugins/extended_choice_parameter/ExtendedChoiceParameterDefinition.java index e31e6c7e..937ccd36 100644 --- a/src/main/java/com/cwctravel/hudson/plugins/extended_choice_parameter/ExtendedChoiceParameterDefinition.java +++ b/src/main/java/com/cwctravel/hudson/plugins/extended_choice_parameter/ExtendedChoiceParameterDefinition.java @@ -529,12 +529,12 @@ public ParameterValue createValue(CLICommand command, String value) { if (valueStr != null) { List result = new ArrayList<>(); - String[] values = valueStr.split(","); + String[] values = valueStr.trim().split("\\s*,\\s*"); Set valueSet = new HashSet<>(Arrays.asList(values)); for (String requestValue : requestValues) { - if (valueSet.contains(requestValue)) { - result.add(requestValue); + if (valueSet.contains(requestValue.trim())) { + result.add(requestValue.trim()); } }