Skip to content

feat(jira): collect required fields for transitions (resolution form) - #10651

Closed
innocarpe wants to merge 0 commit into
stablyai:mainfrom
innocarpe:fix/jira-transition-required-fields
Closed

innocarpe wants to merge 0 commit into
stablyai:mainfrom
innocarpe:fix/jira-transition-required-fields

Conversation

@innocarpe

@innocarpe innocarpe commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • listTransitions requests expand=transitions.fields and maps required-field metadata (with bare-list fallback).
  • Status pill: one-click for simple transitions; resolution/comment form when required; unsupported required types get a clear message + Open in Jira.
  • updateIssue posts fields / comment update with the transition id.

Fixes

Closes #10565

Test plan

  • jira issues listTransitions/updateIssue tests, transition-fields unit tests, RPC schema tests
  • Manual: Jira Cloud workflow with resolution-required Close transition

ELI5

Changing Jira issue status that requires fields like Resolution now prompts for them in Orca instead of failing silently. Simple transitions stay one-click; complex ones get a small form or a clear open-in-Jira path.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Jira transition handling now maps expanded transition fields and supports transition-required fields and comments in issue updates. Shared helpers classify transitions as single-click, supported form, or unsupported. RPC and IPC validation accept the new transition payload properties with shape checks. The Jira issue workspace independently loads transitions and provides retry handling, unsupported-transition messaging, resolution selection, comment input, and conditional popover reset after updates. Tests cover mapping, fallback behavior, payload construction, validation utilities, and UI-supporting classification logic.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description covers summary and tests, but it omits the required Screenshots, AI Review Report, Security Audit, and Notes sections. Add the missing template sections, especially screenshots/no visual change, AI review report, security audit, and notes.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes align with #10565 by expanding transition metadata, adding a resolution/comment form, handling unsupported fields, and falling back when expand fails.
Out of Scope Changes check ✅ Passed No clear out-of-scope changes are visible; the added UI, schema, and tests all support Jira transition-required-field handling.
Title check ✅ Passed The title clearly summarizes the main Jira transition-fields enhancement and mentions the resolution form.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
src/shared/jira-transition-fields.ts (1)

58-60: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider exporting a value-key helper alongside the label helper.

JiraIssueWorkspace.tsx derives an option key with value.id ?? value.value ?? value.name ?? '' (Line 770) while the initial draft is derived as id ?? name ?? value (Line 422). Centralizing the identity derivation here would keep both call sites consistent.

♻️ Proposed helper
 export function transitionAllowedValueLabel(value: JiraCreateFieldAllowedValue): string {
   return value.name ?? value.value ?? value.id ?? 'Option'
 }
+
+export function transitionAllowedValueKey(value: JiraCreateFieldAllowedValue): string {
+  return value.id ?? value.value ?? value.name ?? ''
+}
src/renderer/src/components/JiraIssueWorkspace.tsx (2)

358-385: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

reloadTransitions lacks the stale-response guard used by the load effect.

If the user retries and then switches issues, the in-flight result still lands in transitions/transitionsError for the new issue. Capture requestIdRef.current and compare before each set*, as the effect at Lines 264-290 does.


763-778: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Prefer the shadcn Select primitive over a raw <select>.

Native <select> won't pick up popover styling/tokens and diverges from the rest of the surface. As per coding guidelines, UI work must "use shadcn primitives from src/renderer/src/components/ui/".

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f52889a7-ebf6-4bc0-811e-ce1033805ce6

📥 Commits

Reviewing files that changed from the base of the PR and between 1648262 and a1a595f.

📒 Files selected for processing (8)
  • src/main/ipc/jira.ts
  • src/main/jira/issues.test.ts
  • src/main/jira/issues.ts
  • src/main/runtime/rpc/methods/jira.ts
  • src/renderer/src/components/JiraIssueWorkspace.tsx
  • src/shared/jira-transition-fields.test.ts
  • src/shared/jira-transition-fields.ts
  • src/shared/jira-types.ts

@innocarpe

Copy link
Copy Markdown
Contributor Author

Sync update (e2a054ac0)

Address CodeRabbit: unify resolution draft seed and option values via transitionAllowedValueKey (id ?? value ?? name).

@nwparker nwparker added the enhancement New feature or request label Jul 27, 2026
@innocarpe innocarpe closed this Oct 29, 2026
@innocarpe
innocarpe force-pushed the fix/jira-transition-required-fields branch from e2a054a to e4ab9fe Compare October 29, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Support Jira transitions with required fields (resolution on Close, etc.) — currently they fail with only a raw API toast

3 participants