Skip to content

Fix: Coerce numeric dropdown/status/multiselect custom field values to strings - #406

Merged
rafaeljusto merged 1 commit into
mainfrom
fix/customfields2
Jul 24, 2026
Merged

Fix: Coerce numeric dropdown/status/multiselect custom field values to strings#406
rafaeljusto merged 1 commit into
mainfrom
fix/customfields2

Conversation

@rafaeljusto

Copy link
Copy Markdown
Contributor

Description

Setting a choice-based custom field value via create/update_custom_field_value failed for numeric input: the value was forwarded verbatim, so a JSON number reached the API where dropdown/status/multiselect choices are stored as strings, yielding "cannot unmarshal number ... into string" (dropdown custom fields could not be set through the connector at all).

Resolve the field type and stringify the value for dropdown, status and multiselect fields before sending; number, checkbox, date and other types pass through unchanged. The field lookup only runs when the value actually carries a number, so the common string-value path adds no extra call. Also correct the misleading "option IDs for dropdown" wording in the value schema and allow numeric elements in the multiselect array branch.

Adds a routed mock that captures the request body so tests assert the coerced wire payload.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Testing

  • Tests pass locally (go test -v ./...)
  • Added/updated tests for new functionality

Checklist

  • Code follows project style guidelines
  • Self-reviewed the code
  • Added necessary documentation
  • No new warnings or errors

…o strings

Setting a choice-based custom field value via create/update_custom_field_value
failed for numeric input: the value was forwarded verbatim, so a JSON
number reached the API where dropdown/status/multiselect choices are
stored as strings, yielding "cannot unmarshal number ... into string"
(dropdown custom fields could not be set through the connector at all).

Resolve the field type and stringify the value for dropdown, status and
multiselect fields before sending; number, checkbox, date and other
types pass through unchanged. The field lookup only runs when the value
actually carries a number, so the common string-value path adds no extra
call. Also correct the misleading "option IDs for dropdown" wording in
the value schema and allow numeric elements in the multiselect array
branch.

Adds a routed mock that captures the request body so tests assert the
coerced wire payload.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rafaeljusto
rafaeljusto requested a review from a team as a code owner July 24, 2026 12:52
@rafaeljusto
rafaeljusto merged commit 53f7f95 into main Jul 24, 2026
3 checks passed
@rafaeljusto
rafaeljusto deleted the fix/customfields2 branch July 24, 2026 16:55
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