Skip to content

feat(jira): add --field flag for custom fields on issue create and update#2

Open
andinger wants to merge 2 commits intoBjoernSchotte:mainfrom
andinger:feature/custom-fields-flag
Open

feat(jira): add --field flag for custom fields on issue create and update#2
andinger wants to merge 2 commits intoBjoernSchotte:mainfrom
andinger:feature/custom-fields-flag

Conversation

@andinger
Copy link

Problem

jira issue create and jira issue update only support a hardcoded set of standard fields. There is currently no way to set custom fields (e.g. customfield_10028 for Story Points) via the CLI — requiring users to fall back to direct REST API calls with curl.

Solution

Add a repeatable --field <id>=<value> flag to both commands. Values are auto-coerced to the correct type before being passed to the Jira API:

Input Result
customfield_10028=5 5 (number)
customfield_10194=Some text "Some text" (string)
customfield_10077={"value":"Feature"} { value: "Feature" } (object)
customfield_10195=[{"value":"A"}] [{ value: "A" }] (array)
customfield_10028=null null

Usage

# Create with custom fields
atlcli jira issue create \
  --project PROJ --type Story --summary "My story" \
  --field customfield_10028=5 \
  --field customfield_10077={"value":"Feature"} \
  --field customfield_10194="As a user I want to..."

# Update custom fields on existing issue
atlcli jira issue update --key PROJ-123 \
  --field customfield_10028=8 \
  --field customfield_10079=3

Changes

  • apps/cli/src/commands/jira.ts
    • Import getFlags from @atlcli/core (already exported, handles repeated flags → string[])
    • Add parseCustomFields() helper with type coercion
    • Wire --field into handleIssueCreate and handleIssueUpdate
    • Update issueHelp() with flag documentation

Testing

Verified against a live Jira Cloud instance. The flag correctly passes custom field values through to the API; field availability errors (wrong screen/issue type) are returned by Jira as expected.

…date

Add support for setting arbitrary Jira custom fields via a repeatable
--field <id>=<value> flag on both `jira issue create` and `jira issue update`.

Values are auto-coerced by type:
- numeric strings  → number
- "null"           → null
- valid JSON       → parsed (enables option objects and arrays)
- everything else  → string

Example usage:
  atlcli jira issue create \
    --project PROJ --type Story --summary "My story" \
    --field customfield_10028=5 \
    --field customfield_10077={"value":"Feature"}

  atlcli jira issue update --key PROJ-123 \
    --field customfield_10028=8 \
    --field customfield_10079=3
- issues.md: add --field to Create/Update options tables, new
  "Custom Fields" section with type coercion table, value syntax
  for option/multi-select/user fields, field discovery workflow,
  and a note on field availability; remove stale bulk-edit tip
- fields.md: replace non-existent --set syntax with correct --field
  flag and cross-reference to the new custom fields section
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