theonedev/onedev · error · ValidationException

Not eligible for multi-value

Error message

Not eligible for multi-value

What it means

IssueChoiceInput accepts only one value per submission: the strings.size()==1 branch parses a single id, and any collection larger than one hits the else branch throwing ValidationException('Not eligible for multi-value').

Source

Thrown at server-core/src/main/java/io/onedev/server/buildspecmodel/inputspec/IssueChoiceInput.java:37

			buffer.append("    @NotNull\n");
		buffer.append("    @IssueChoice(useNumber=true)\n");
		inputSpec.appendMethods(buffer, index, "Long", null, null);
		
		return buffer.toString();
	}

	public static Object convertToObject(List<String> strings) {
		if (strings.size() == 0) {
			return null;
		} else if (strings.size() == 1) {
			String value = strings.iterator().next();
			try {
				return Long.valueOf(value);
			} catch (NumberFormatException e) {
				throw new ValidationException("Invalid issue id/number");
			}
		} else {
			throw new ValidationException("Not eligible for multi-value");
		}
	}

	public static List<String> convertToStrings(Object value) {
		if (value instanceof Long)
			return Lists.newArrayList(value.toString());
		else
			return new ArrayList<>();
	}

}

View on GitHub (pinned to d44925c47c)

Solutions

  1. Pass exactly one issue id for this input.
  2. Remove multiple selection in the form before submitting.
  3. If several issues are needed, create separate issue-choice inputs.
  4. Fix the script to submit a scalar value rather than an array.

Example fix

// before
values: ["12", "34"]
// after
value: "12"
Defensive patterns

Strategy: validation

Validate before calling

// Ensure single value before converting
if (values != null && values.size() > 1) {
  throw new Error("Issue choice input accepts exactly one value");
}

Try / catch

try {
    Object issue = IssueChoiceInput.convertToObject(strings);
} catch (ValidationException e) {
    if (e.getMessage().contains("multi-value")) {
        // take first element or ask user to select one
    }
}

Prevention

When it happens

Trigger: convertToObject called with more than one string for an issue-choice input, e.g. multiple values selected in the form or a list passed programmatically.

Common situations: Submitting a multi-value list from an automation script; input mistakenly configured/rendered as multi-select; reusing a multi-value parameter definition for an issue choice input.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06). Data as JSON: /api/errors/08f8d01b9daa554b. Report an issue: GitHub.