Skip to content

feat(issue): accept priority as numeric ID via --priority-id - #149

Merged
f3rdy merged 2 commits into
masterfrom
feat/136-priority-id
Oct 21, 2026
Merged

f3rdy merged 2 commits into
masterfrom
feat/136-priority-id

Conversation

@f3rdy

@f3rdy f3rdy commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Why (from #136)

--priority is always sent as {"name": ...}. That only works on instances whose priorities address by name; others expect {"id": "3"} — a known stumbling block in the affected customer team's own Jira skill.

What

  • --priority-id ID on create issue and issue update sends {"id": ...}; mutually exclusive with --priority.
  • A rejected priority no longer dies in a generic Invalid issue data: on a 400 involving a priority, the error lists the values the instance actually offers (best-effort priorities() read; a failing lookup never masks the original error).

Design decision: explicit flag, not a numeric heuristic

The ticket sketched "purely numeric value → {"id": ...}, else {"name": ...} (or an explicit --priority-id; decide in repo context)". The explicit flag won, because the measuring instance itself names its priorities literally 1..4: there a numeric value is ambiguous, and a heuristic would silently change what working calls send — breaking the rule that defaults preserve today's behaviour for exactly the users the feature is for.

Default / compatibility

Unchanged: without --priority-id everything is sent as before, and no heuristic re-interprets existing --priority values.

Tests

  • Service: id vs name payload on create and update, id wins when both are given, 400-hint with name and id, no hint without priority, failing priorities read falls back to the original error (9 tests).
  • CLI: --priority-id reaches the service on create and update; conflict with --priority exits 1 without constructing a client.
  • Full suite: 1433 passed, 3 skipped; ruff, mypy, bandit green.
  • budjira ai usage-prompt --plain output checked; regenerated prompt committed separately.

Note: this touches the same create/update region in services/issues.py as #147 (--dry-run payload builders). Whichever merges second gets a small rebase — offered as part of the session.

Closes #136

f3rdy added 2 commits October 21, 2026 14:21
--priority always sent {"name": ...}, which instances reject whose
priorities only address by ID. --priority-id sends {"id": ...} on
create issue and issue update; the options are mutually exclusive and
the default path is unchanged.

A numeric-value heuristic (digits mean id) was considered and rejected:
on instances whose priorities are literally named "1".."4" a numeric
value is ambiguous, and silently changing its meaning would break
exactly the usage that works today.

A rejected priority no longer dies in a generic "Invalid issue data":
on a 400 involving a priority, the error lists the values the instance
actually offers (best-effort read; a failing lookup never masks the
original error).

Closes #136
Regenerate .claude/ai-usage-prompt.md after --priority-id.
@f3rdy
f3rdy force-pushed the feat/136-priority-id branch from 99cd27b to 14730e7 Compare October 21, 2026 12:23
@f3rdy
f3rdy merged commit 3afb606 into master Oct 21, 2026
5 checks passed
@f3rdy
f3rdy deleted the feat/136-priority-id branch October 21, 2026 12:31
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.

feat(fields): allow priority to be given as an ID, not only a name

1 participant