feat: add transition, link, array ops, and bulk set commands - #12
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
jai transition— execute workflow transitions with case-insensitive name resolution,--listflag, and auto-push to Jirajai link— create issue links with--typeflag,--list-types, case-insensitive type resolution, and clear error when a link type doesn't existjai set --add/--remove— add/remove values on array fields (labels, components, fixVersions) with field type validationjai setcomma-separated keys — bulk set onROX-1,ROX-2,ROX-3jai set --query— bulk set using a SQL query that returns akeycolumnjai init --config— wire--configflag through init wizard, auto-derive DB path from config name, expand tilde in db path--add/--removehelp text syntax, fixed empty array storing"null"instead of empty stringTest plan
go test -tags fts5 ./...)--query, zero results, bad SQL--list-types