Skip to content

fix: handle "drop_down" type for custom field resolution#3

Open
neptunix wants to merge 1 commit intotriptechtravel:mainfrom
neptunix:fix/dropdown-type-mismatch
Open

fix: handle "drop_down" type for custom field resolution#3
neptunix wants to merge 1 commit intotriptechtravel:mainfrom
neptunix:fix/dropdown-type-mismatch

Conversation

@neptunix
Copy link

@neptunix neptunix commented Mar 6, 2026

Summary

  • The ClickUp API returns dropdown field types as "drop_down" (with underscore), but parseFieldValue and formatCustomFieldValue only match "dropdown" (without underscore)
  • This causes --field to fall through to the default case, sending the raw display name (e.g. "Bug") instead of the resolved UUID
  • The API rejects this with 400 Value must be an option index or uuid FIELD_011

Two-line fix: add "drop_down" as an alias in both switch statements.

Reproduction

clickup task create --list-id <any-list> --name "Test" --field "Task Type=Bug"
# Error: task created but failed to set custom field "Task Type": ... 400 Value must be an option index or uuid

Test

After fix:

clickup task create --list-id <list> --name "Test" --field "Task Type=Bug"
# Success: task created with Task Type field correctly set

The ClickUp API returns dropdown field types as "drop_down" (with
underscore), but parseFieldValue and formatCustomFieldValue only
check for "dropdown" (without underscore).

This causes --field to fall through to the default case, sending
the raw display name (e.g. "Bug") instead of the resolved UUID,
which the API rejects with "Value must be an option index or uuid".

Add "drop_down" as an alias alongside "dropdown" in both switch
statements to handle the API's actual response format.

Fixes triptechtravel#2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant