Skip to content

fix(jtk): multi-checkbox custom fields only set last value #166

@rianjs

Description

@rianjs

Problem

When updating a multi-checkbox custom field (com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes) via jtk issue update, only a single value can be set. There's no syntax to set multiple values at once.

Attempt 1 — multiple --field flags with the same key:

jtk issue update ON-483 --field "customfield_10154=CheckSync" --field "customfield_10154=MoniCore" --field "customfield_10154=Monit Accounting"
# Result: only "Monit Accounting" is set (last value wins)

Attempt 2 — comma-separated values:

jtk issue update ON-483 --field 'customfield_10154=CheckSync,MoniCore,Monit Accounting'
# Result: bad request: Option value 'CheckSync,MoniCore,Monit Accounting' is not valid

Attempt 3 — array syntax:

jtk issue update ON-483 --field 'customfield_10154=[CheckSync,MoniCore,Monit Accounting]'
# Result: bad request: Option value '[CheckSync,MoniCore,Monit Accounting]' is not valid

Workaround

Direct REST API call works:

curl -X PUT "https://instance.atlassian.net/rest/api/3/issue/ON-483" \
  -u "user@example.com:$JIRA_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"fields":{"customfield_10154":[{"value":"CheckSync"},{"value":"MoniCore"},{"value":"Monit Accounting"}]}}'

Root Cause

The --field flag appears to parse values as a single string and construct a single-element array [{"value": "..."}] for select/checkbox fields. Duplicate --field keys overwrite rather than accumulate.

Proposed Solution

Support a delimiter syntax (e.g., pipe or semicolon) for multi-value fields:

jtk issue update ON-483 --field 'customfield_10154=CheckSync|MoniCore|Monit Accounting'

Or support repeated --field flags accumulating values for the same key rather than overwriting.

Version

jtk v0.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions