-
Notifications
You must be signed in to change notification settings - Fork 1
Custom fields feature only works with Enum types #638
Description
Problem
The custom fields feature (--custom-field) added in v0.22.0 has a critical limitation: it assumes all custom fields are Enum types and fails with type mismatch errors for other field types like Simple, Text, User, Version, etc.
When users specify custom fields via --custom-field "FieldName=value", the CLI formats all fields as SingleEnumIssueCustomField with EnumBundleElement values, regardless of the actual field type in YouTrack.
Root Cause
Code locations:
services/issues.pyline 84 (create_issue)services/issues.pyline 252 (update_issue)
Both locations hardcode:
CustomFieldManager.create_single_enum_field(field_name, field_value)Example Failure
Command:
yt issues update DEMO-20 --custom-field "dumb=test-value"Expected behavior: SimpleIssueCustomField with SimpleIssueCustomFieldValue
Actual behavior: SingleEnumIssueCustomField with EnumBundleElement
Result: YouTrack API returns 400 error - type mismatch
Impact
Currently works: Enum-type fields (Priority, Type)
Currently fails: Simple, Text, User, Version, and other non-enum field types
Solution Required
The CLI needs to support all custom field types, not just enums. Options:
- Query project custom field definitions to detect field types before sending to API
- Implement formatters for all field types (Simple, User, Version, etc.)
- Add intelligent type detection with fallback logic
- Document the limitation if not fixing