Skip to content

feat: add transition, link, array ops, and bulk set commands - #12

Merged
sthadka merged 9 commits into
mainfrom
feat/rit-gaps
Jul 22, 2026
Merged

feat: add transition, link, array ops, and bulk set commands#12
sthadka merged 9 commits into
mainfrom
feat/rit-gaps

Conversation

@sthadka

@sthadka sthadka commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • jai transition — execute workflow transitions with case-insensitive name resolution, --list flag, and auto-push to Jira
  • jai link — create issue links with --type flag, --list-types, case-insensitive type resolution, and clear error when a link type doesn't exist
  • jai set --add/--remove — add/remove values on array fields (labels, components, fixVersions) with field type validation
  • jai set comma-separated keys — bulk set on ROX-1,ROX-2,ROX-3
  • jai set --query — bulk set using a SQL query that returns a key column
  • jai init --config — wire --config flag through init wizard, auto-derive DB path from config name, expand tilde in db path
  • Bug fixes — corrected --add/--remove help text syntax, fixed empty array storing "null" instead of empty string

Test plan

  • 117 unit tests pass (go test -tags fts5 ./...)
  • Manual validation against staging Jira instance (all 5 sections of test-rit-gaps.md)
    • Array field add/remove/replace
    • Comma-separated array serialization
    • Transition list/execute/case-insensitive/bad-name
    • Bulk set with comma keys, --query, zero results, bad SQL
    • Link create, typed link, --list-types

sthadka added 9 commits July 22, 2026 16:52
Queue and immediately push workflow transitions via
`jai transition <key> <status>`. Supports --list flag to show
available transitions, case-insensitive name matching, ambiguous
match detection, and JSON output.
Support add/remove operations on array fields (labels, components,
fixVersions) without overwriting existing values. Validates that
the target field has type "array" via field_map. Queues "update_field"
operations that the writer sends using Jira's update API format:
{"update":{"labels":[{"add":"value"}]}}.

Includes optimistic local DB updates that read the current JSON array,
apply the add/remove ops, and write back.
Add `jai link <from-key> <to-key>` to create issue links directly via
the Jira API. Supports --type flag for link type (defaults to "Relates")
and --list-types to show available link types. Links are pushed
immediately since they are simple and idempotent.
Support setting field values on multiple issues at once via:
- --query flag: runs a SQL query, extracts 'key' column, queues changes
- comma-separated keys: jai set ROX-1,ROX-2 priority Major

Bulk mode reports summary count; --json returns {count, keys}.
The init command was hardcoding DefaultConfigPath() for both reading
existing config and writing new config, ignoring the --config flag.
Also derives a separate DB path from the config filename when using
a non-default config (e.g., staging.yaml → staging.db) so multiple
Jira environments don't share a database. Expands ~/  in db.path
loaded from config YAML since Go doesn't resolve tildes in paths.
…play

- Fix --add/--remove examples to show field name as positional arg
- Add case-insensitive link type resolution with clear error on mismatch
- Store empty string instead of "null" when all array elements are removed
Add transition, link, array ops (--add/--remove), and bulk set
commands to the README commands table and write operations section.
Create docs/user-guide.md covering day-to-day usage including
multi-environment configs, all write operations, and agent mode.
- Apply De Morgan's law in fmQuote (QF1001)
- Use fmt.Fprintf instead of WriteString+Sprintf (QF1012)
- Remove punctuation/newlines from error string (ST1005)
- Use strings.TrimPrefix instead of if+slice (S1017)
- Convert if/else chain to tagged switch (QF1003)
- Remove unused jsonErr/jsonError functions and output import
- Remove unused colorRules field from TableModel
@sthadka
sthadka merged commit 7e7c21a into main Jul 22, 2026
2 checks passed
@sthadka
sthadka deleted the feat/rit-gaps branch July 22, 2026 21:30
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