Skip to content

feat(jtk): add --custom-fields to create, update, assign and transitions do - #503

Open
piekstra wants to merge 3 commits into
mainfrom
piekstra/custom-fields-on-mutations
Open

piekstra wants to merge 3 commits into
mainfrom
piekstra/custom-fields-on-mutations

Conversation

@piekstra

@piekstra piekstra commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

issues create, issues update, issues assign and transitions do print the issue after the write, but only the standard detail view. A custom field set with --field customfield_NNNNN=... could not be confirmed without a follow-up issues get --custom-fields.

These four commands now take --custom-fields, which appends the same Custom Fields: section issues get --custom-fields shows: every non-empty customfield_* value, labeled with the field's name from the field cache.

$ jtk issues update PROJ-123 --field customfield_10005=Feature --custom-fields
PROJ-123  Example issue
Status: Backlog   Type: Task   Priority: Medium   Points: 5
...

Custom Fields:
  Change type: Feature

Behavior is unchanged without the flag. The section is appended inside each command's existing post-write fetch, so the retry schedule, the freshness checks, the fallback confirmation and --id behave as before. If field metadata cannot be loaded, the section is left out, as in issues get.

Shared helper. The section builder moved from an unexported function in issues/get.go to present.AppendIssueCustomFields, so the issues and transitions packages use one implementation. issues get now calls it too.

Not changed: sprints add and sprints remove print a table, not a detail view; custom fields as table columns are already available on issues list, issues search and sprints issues through --fields "<field name>".

Tests: TestMutations_CustomFieldsFlag (create, update, assign, each with and without the flag) and TestRunDo_CustomFieldsFlag (transitions do). Existing call sites gain the new argument. make check passes (tidy, lint, tests, build).

…ons do

The post-write issue view of these commands can now append the same Custom Fields section as issues get --custom-fields, so a custom field set with --field can be confirmed without a second command. The section builder moves to internal/present so the issues and transitions packages share it.

@monit-reviewer monit-reviewer left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated PR Review

Reviewed commit: 2406d95a103c
Profile: claude-monit-reviewer - Posting as: monit-reviewer

Summary

Reviewer Findings
go:implementation-tests 0
policies:conventions 0
architecture:solid-reviewer-agnostic 1
architecture:solid-reviewer-agnostic (1 finding)

Major - tools/jtk/internal/present/custom_fields.go:17

U-S3 / U-D1: AppendIssueCustomFields moves cache reads and a possible live GetFields network call into internal/present, which docs/development.md describes as the package that "owns output rendering". Until now present took data in and rendered it (refresh.go uses only cache types, and projection.Resolve takes fetchFields func(context.Context) ([]api.Field, error) instead of reaching for the cache itself). This helper takes a concrete *api.Client, calls cache.GetFieldsCacheFirst ambiently and swallows the error, so the render layer now has hidden IO and cannot be unit-tested without an HTTP server. Later presenters are likely to copy it.

Suggested fix: keep the shared code but split it along the existing seam. Either (a) give the helper the same injected shape projection.Resolve uses: AppendIssueCustomFields(ctx, fetchFields func(context.Context) ([]api.Field, error), issue *api.Issue, model *present.OutputModel), with the commands passing fieldsFetcher(client) (already in internal/cmd/issues/cache_helpers.go; transitions would need an equivalent or a shared cmd-side home); or (b) make present pure, AppendIssueCustomFieldsFrom(model, issue, fields []api.Field), and do the fetch in the command closures. Either option keeps the documented "section omitted when metadata cannot load" behavior in the caller, where the effect is visible.

Reviewer Coverage

  • go:implementation-tests — complete (broad); inspected 12 assigned files (14 inspected across reviewers): tools/jtk/internal/cmd/issues/assign.go, tools/jtk/internal/cmd/issues/assign_test.go, tools/jtk/internal/cmd/issues/create.go, tools/jtk/internal/cmd/issues/create_test.go, tools/jtk/internal/cmd/issues/custom_fields_mutation_test.go, tools/jtk/internal/cmd/issues/get.go, tools/jtk/internal/cmd/issues/update.go, tools/jtk/internal/cmd/issues/update_test.go, tools/jtk/internal/cmd/transitions/custom_fields_test.go, tools/jtk/internal/cmd/transitions/transitions.go, tools/jtk/internal/cmd/transitions/transitions_test.go, tools/jtk/internal/present/custom_fields.go; skipped: none; constraints: none
  • policies:conventions — complete (broad); inspected 6 assigned files (14 inspected across reviewers): tools/jtk/README.md, tools/jtk/internal/cmd/issues/assign.go, tools/jtk/internal/cmd/issues/create.go, tools/jtk/internal/cmd/issues/get.go, tools/jtk/internal/cmd/issues/update.go, tools/jtk/internal/cmd/transitions/transitions.go; skipped: none; constraints: No sibling ../cli-common/docs or ../.github checkouts present in this workbench, so shared Open CLI Collective standards docs were not directly consulted; relied on repo-local conventions visible in README.md, CHANGELOG.md and existing code.
  • architecture:solid-reviewer-agnostic — complete (broad); inspected 7 assigned files (14 inspected across reviewers): tools/jtk/CHANGELOG.md, tools/jtk/internal/cmd/issues/assign.go, tools/jtk/internal/cmd/issues/create.go, tools/jtk/internal/cmd/issues/get.go, tools/jtk/internal/cmd/issues/update.go, tools/jtk/internal/cmd/transitions/transitions.go, tools/jtk/internal/present/custom_fields.go; skipped: none; constraints: Did not run make check or the test suite; reviewed the diff and surrounding package code statically.
Inspected files (14)
  • tools/jtk/CHANGELOG.md
  • tools/jtk/README.md
  • tools/jtk/internal/cmd/issues/assign.go
  • tools/jtk/internal/cmd/issues/assign_test.go
  • tools/jtk/internal/cmd/issues/create.go
  • tools/jtk/internal/cmd/issues/create_test.go
  • tools/jtk/internal/cmd/issues/custom_fields_mutation_test.go
  • tools/jtk/internal/cmd/issues/get.go
  • tools/jtk/internal/cmd/issues/update.go
  • tools/jtk/internal/cmd/issues/update_test.go
  • tools/jtk/internal/cmd/transitions/custom_fields_test.go
  • tools/jtk/internal/cmd/transitions/transitions.go
  • tools/jtk/internal/cmd/transitions/transitions_test.go
  • tools/jtk/internal/present/custom_fields.go

0 PR discussion threads considered. 0 summarized; 0 resolved.


Completed in 2m 23s | ~$1.83 (est.) | claude-sonnet-5, claude-opus-5-5 | cr 0.10.319
Field Value
Model claude-sonnet-5, claude-opus-5-5
Reviewers go:implementation-tests, policies:conventions, architecture:solid-reviewer-agnostic
Engine claude_cli · claude-sonnet-5, claude-opus-5-5
Reviewed by cr · monit-reviewer
Duration 2m 23s wall · 3m 40s compute
Cost ~$1.83 (est.)
Pricing basis anthropic-public-2026-09-23
Tokens 56 in / 12.2k out

Per-workstream usage

  • orchestrator-selection — claude-sonnet-5
    • In: 6
    • Out: 3.5k
    • Cache read: 85.2k
    • Cache create: 51.4k
    • Cost: ~$0.26 (est.)
    • Duration: 46s
  • go:implementation-tests — claude-sonnet-5
    • In: 10
    • Out: 2.0k
    • Cache read: 215.6k
    • Cache create: 71.1k
    • Cost: ~$0.35 (est.)
    • Duration: 41s
  • policies:conventions — claude-sonnet-5
    • In: 18
    • Out: 2.5k
    • Cache read: 440.3k
    • Cache create: 59.5k
    • Cost: ~$0.35 (est.)
    • Duration: 59s
  • architecture:solid-reviewer-agnostic — claude-opus-5-5
    • In: 16
    • Out: 3.6k
    • Cache read: 366.0k
    • Cache create: 68.6k
    • Cost: ~$0.69 (est.)
    • Duration: 54s
  • orchestrator-rollup — claude-sonnet-5
    • In: 6
    • Out: 549
    • Cache read: 151.3k
    • Cache create: 36.9k
    • Cost: ~$0.18 (est.)
    • Duration: 17s

Comment thread tools/jtk/internal/present/custom_fields.go Outdated

@monit-reviewer monit-reviewer left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated PR Review

Reviewed commit: 77c526f0a5fd
Profile: claude-monit-reviewer - Posting as: monit-reviewer

Summary

Reviewer Findings
go:implementation-tests 0
policies:conventions 0
architecture:solid-reviewer-agnostic 0

Reviewer Coverage

  • go:implementation-tests — complete (constrained); inspected 13 assigned files (15 inspected across reviewers): tools/jtk/internal/cmd/issues/assign.go, tools/jtk/internal/cmd/issues/assign_test.go, tools/jtk/internal/cmd/issues/create.go, tools/jtk/internal/cmd/issues/create_test.go, tools/jtk/internal/cmd/issues/custom_fields_mutation_test.go, tools/jtk/internal/cmd/issues/get.go, tools/jtk/internal/cmd/issues/update.go, tools/jtk/internal/cmd/issues/update_test.go, tools/jtk/internal/cmd/transitions/custom_fields_test.go, tools/jtk/internal/cmd/transitions/transitions.go, tools/jtk/internal/cmd/transitions/transitions_test.go, tools/jtk/internal/present/custom_fields.go, tools/jtk/internal/present/custom_fields_test.go; skipped: none; constraints: none
  • policies:conventions — complete (constrained); inspected 6 assigned files (15 inspected across reviewers): tools/jtk/README.md, tools/jtk/internal/cmd/issues/assign.go, tools/jtk/internal/cmd/issues/create.go, tools/jtk/internal/cmd/issues/get.go, tools/jtk/internal/cmd/issues/update.go, tools/jtk/internal/cmd/transitions/transitions.go; skipped: none; constraints: No sibling ../cli-common/docs or ../.github checkouts present in this workbench, so shared Open CLI Collective standards docs were not directly consulted; relied on repo-local conventions visible in README.md, CHANGELOG.md and existing code.
  • architecture:solid-reviewer-agnostic — complete (constrained); inspected 7 assigned files (15 inspected across reviewers): tools/jtk/CHANGELOG.md, tools/jtk/internal/cmd/issues/assign.go, tools/jtk/internal/cmd/issues/create.go, tools/jtk/internal/cmd/issues/get.go, tools/jtk/internal/cmd/issues/update.go, tools/jtk/internal/cmd/transitions/transitions.go, tools/jtk/internal/present/custom_fields.go; skipped: none; constraints: Did not run make check or the test suite; reviewed the diff and surrounding package code statically. The earlier U-S3/U-D1 finding on present/custom_fields.go is resolved at 77c526f: the helper takes an injected fetchFields func, no longer imports cache, and has direct unit tests. The inline closure in transitions.go matches the existing sprints.go pattern.
Inspected files (15)
  • tools/jtk/CHANGELOG.md
  • tools/jtk/README.md
  • tools/jtk/internal/cmd/issues/assign.go
  • tools/jtk/internal/cmd/issues/assign_test.go
  • tools/jtk/internal/cmd/issues/create.go
  • tools/jtk/internal/cmd/issues/create_test.go
  • tools/jtk/internal/cmd/issues/custom_fields_mutation_test.go
  • tools/jtk/internal/cmd/issues/get.go
  • tools/jtk/internal/cmd/issues/update.go
  • tools/jtk/internal/cmd/issues/update_test.go
  • tools/jtk/internal/cmd/transitions/custom_fields_test.go
  • tools/jtk/internal/cmd/transitions/transitions.go
  • tools/jtk/internal/cmd/transitions/transitions_test.go
  • tools/jtk/internal/present/custom_fields.go
  • tools/jtk/internal/present/custom_fields_test.go

0 PR discussion threads considered. 0 summarized; 0 resolved.


Completed in 1m 47s | ~$1.89 (est.) | claude-sonnet-5, claude-opus-5-5 | cr 0.10.319
Field Value
Model claude-sonnet-5, claude-opus-5-5
Reviewers go:implementation-tests, policies:conventions, architecture:solid-reviewer-agnostic
Engine claude_cli · claude-sonnet-5, claude-opus-5-5
Reviewed by cr · monit-reviewer
Duration 1m 47s wall · 2m 25s compute
Cost ~$1.89 (est.)
Pricing basis anthropic-public-2026-09-23
Tokens 34 in / 6.2k out

Per-workstream usage

  • go:implementation-tests — claude-sonnet-5
    • In: 12
    • Out: 2.1k
    • Cache read: 461.9k
    • Cache create: 98.4k
    • Cost: ~$0.51 (est.)
    • Duration: 48s
  • policies:conventions — claude-sonnet-5
    • In: 8
    • Out: 1.8k
    • Cache read: 225.0k
    • Cache create: 83.1k
    • Cost: ~$0.40 (est.)
    • Duration: 46s
  • architecture:solid-reviewer-agnostic — claude-opus-5-5
    • In: 8
    • Out: 1.9k
    • Cache read: 277.8k
    • Cache create: 100.7k
    • Cost: ~$0.90 (est.)
    • Duration: 34s
  • orchestrator-rollup — claude-sonnet-5
    • In: 6
    • Out: 432
    • Cache read: 193.4k
    • Cache create: 11.1k
    • Cost: ~$0.09 (est.)
    • Duration: 15s

@piekstra
piekstra marked this pull request as ready for review October 13, 2026 14:56
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.

2 participants