Skip to content

feat(jira): pick the assignee when creating an issue — Automatic, me, or anyone - #24376

Merged
nwparker merged 9 commits into
stablyai:mainfrom
kazuki-hanai:kazuki-hanai/jira-create-assignee
Oct 5, 2026
Merged

nwparker merged 9 commits into
stablyai:mainfrom
kazuki-hanai:kazuki-hanai/jira-create-assignee

Conversation

@kazuki-hanai

@kazuki-hanai kazuki-hanai commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Choose the assignee while creating a Jira issue: use the project default, assign it to yourself, or search for another user.

What Changed

The create dialog now reuses the Jira user picker and sends selected user IDs through the existing Cloud/Server user-field conversion. The picker only appears when Jira's create screen accepts an assignee. Local search requests users assignable to the target project using its key, as required by Jira Server/Data Center.

Selections belong to the effective project, site, and provider. Changing a site filter or provider clears them before submission, including when the dialog was closed; changing only the issue type retains the selection. Unknown sites never borrow another site's signed-in identity. Provider changes also remount the picker so cached candidates cannot be selected under a different host. Assign to me stays hidden until connection status belongs to the current host, and status refreshes retain changed account identities even when the email and site count match.

Why

Previously assignment required a second step after creation. Reusing the existing picker and user-field conversion avoids a separate assignment path. Automatic omits the field so Jira applies its project default, including when Jira marks assignee required.

Linked Issue

N/A — no tracking issue was supplied; this review was explicitly requested by a maintainer.

Visual Proof

Captured on macOS in a hidden Electron renderer via Playwright CDP, using the real dialog, picker, and selection hook with fixture Jira users. These are component interaction checks; no live Jira issue was created and full application/backend integration is not claimed.

Before (main):
Before

After (Automatic):
After

Picker and selected user:
Picker
Selected user

Playwright exercised Assign to me, searching for Grace Hopper, choosing that user, and returning to Automatic; each resulting trigger label was asserted.

Testing

At cbda843ae78df3dbcc2beac1134c12116c8cd59f, on macOS:

  • pnpm tc passed after the identity fix; the final commit only renames a local confirmation helper.

  • 142 focused Jira/localization tests and 8 hook-preparation tests passed across Jira issue operations, self-user resolution, create payloads, assignee state, and runtime routing. Regressions cover implicit cross-site changes, stale callbacks, disconnected/unknown identities, query bounds, and remote hosts without user-field support.

  • pnpm run check:code-quality:changed passed, including React Doctor, type-aware checks, and design-system checks.

  • Localization catalogs, extraction, required runtime catalog, and coverage checks passed.

  • Main/preload development bundles built. Full app renderer startup encountered local disk exhaustion; the component proof above completed in an isolated hidden renderer.

  • PR Checks passed at cbda843ae78df3dbcc2beac1134c12116c8cd59f, including static analysis/typecheck, all five unit-test shards, both packaging checks, relay integration, and final verification. Node persistence and test LoC checks also passed.

  • Rendered interactions tested locally through Playwright CDP with fixture Jira data

  • Automated tests added/updated

AI Disclosure

Original implementation: Claude Code (Claude Fable 5). Maintainer review and follow-up fixes: Codex.

Review

Adversarial review fixed two remaining cross-site hazards: implicit project changes retained the previous assignee, and an explicitly unknown site could inherit a single configured site's viewer. The state now resets synchronously on effective target changes. A follow-up review also found cached candidates could survive a provider change with identical project/site IDs; the picker now remounts per provider and a rendered regression verifies old candidates disappear while the new search is pending.

Agent skill upstream boundary

  • Not applicable; no upstream skill source or assets copied.

Notes

Includes one inherited-main CI repair: rename the local hook-confirmation callback from confirm to confirmHook so the localization scanner does not mistake it for the browser API. The behavior is unchanged and 8 focused hook tests pass.

The existing remote user-field capability protects mixed-version hosts. Automatic creation still works without it; explicit user fields produce an update-required error. Remote hosts use their existing site-wide search because they have no project-scoped search RPC, so Jira may reject a remote selection that is not assignable. Native Cloud/Server search and payload differences are tested, including that the renderer sends a project key even when its numeric ID differs. No filesystem, platform shortcut, or git-worktree assumptions were added. Linux/Windows and live SSH/Jira were not manually exercised.

Checklist

  • This PR is small and focused
  • Before/after behavior, mechanism, and rationale described
  • Before/after screenshots attached
  • Reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and folder workspaces considered
  • Full CI passes at the current head

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 3/5

[Medium risk] Adds assignee picker to Jira issue creation dialog.

The PR does not appear safe to merge while cross-site search results remain selectable and unassignable users can still be chosen.

Findings

  1. P1 Previous-site users remain selectable ▶
  2. P1 Unassignable users appear in search ▶
  3. P2 Issue type clears assignee ▶

Summary

The PR adds create-time Jira assignee selection, resolves “Assign to me” for the target site, and sends user-field keys so the host can shape Jira user references. It also adds payload and identity tests.

Reviews (2) · Last reviewed commit: "feat(jira): pick the assignee when creat..."

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 87e7d807-c03e-43f7-9a29-9087dba2b45d
📥 Commits

Reviewing files that changed from the base of the PR and between bf4e62f and cbda843.

📒 Files selected for processing (6)
  • src/renderer/src/components/task-page/jira/IssueAssigneeField.test.tsx
  • src/renderer/src/components/task-page/jira/IssueAssigneeField.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/worktree-creation-hook-preparation.ts
  • src/renderer/src/store/slices/jira-connection-actions.ts
  • src/renderer/src/store/slices/jira-connection-identity.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/i18n/locales/en.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

Jira issue creation now includes an assignee picker when Jira create fields include an assignee field. The picker searches assignable users for the selected project and can offer Automatic and Assign to me options. The selected assignee is scoped to the provider and project. Submission sends populated user fields and the selected assignee account ID. The Jira API, IPC handlers, and runtime client add project-scoped user search, with tests for the search paths, identity selection, picker state, and submission payload.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to cbda8

The assignee picker changes appear ready to merge after normal checks; no actionable merge-blocking issue is established.

Security Architecture Review

Security architecture risk: 🔵 Low · up to cbda8

Assignee selection uses the existing Jira connection and issue-creation permissions. No authorization bypass was established. Remaining uncertainty concerns remote search eligibility and account changes while a selection is retained.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — Normal feature requests target one project and site on the chosen provider. A compromised renderer could supply other site/project identifiers, but the effective authority remains the host’s existing connected Jira credentials; the project picker is not an authorization boundary.

Trust Boundaries and Controls

  • inferred — Renderer-controlled queries and user IDs cross the existing IPC/RPC boundary without supplying credentials or an arbitrary destination URL. Main selects the stored site credential, while Jira remains the final assignment-permission and eligibility authority. The new caller does not establish a bypass of that boundary.

Resilience and Maintainability Implications

  • observed — Search and creation release their request slots in finally blocks. Authentication failures clear only the selected site’s token, preserving the existing per-site failure-containment behavior.

Hardening Proposals

  • proposed — Consider distinguishing a self-selection from an explicit user snapshot and reconfirming it after a same-site account change. This would clarify identity intent without changing Jira’s authorization boundary; it is not a verified vulnerability.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 31.03% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 29 functions across 27 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: choosing an assignee when creating a Jira issue. It is specific and related to the pull request.
Description check ✅ Passed The description covers the required sections with a clear user-facing summary, rationale, visual proof, testing details, review notes, and checklist. It also identifies pending CI and platforms that w…
Full details: Docstring Coverage

Explanation

Docstring coverage is 31.03% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 29 functions across 27 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: d2e31708-863a-4dc9-a7ff-d20c06c3c7dc

📥 Commits

Reviewing files that changed from the base of the PR and between f9940d5 and 3f22893.

📒 Files selected for processing (12)
  • src/preload/api/jira-bridge.ts
  • src/renderer/src/components/jira-self-user.test.ts
  • src/renderer/src/components/jira-self-user.ts
  • src/renderer/src/components/jira-user-picker.tsx
  • src/renderer/src/components/task-page-jira-create-fields.test.ts
  • src/renderer/src/components/task-page-jira-create-fields.ts
  • src/renderer/src/components/task-page/jira/IssueAssigneeField.tsx
  • src/renderer/src/components/task-page/jira/IssueDialog.tsx
  • src/renderer/src/components/use-task-page-jira-creation-metadata.ts
  • src/renderer/src/components/use-task-page-jira-creation-state.ts
  • src/renderer/src/components/use-task-page-jira-issue-creation.ts
  • src/renderer/src/i18n/locales/en.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@pullfrog pullfrog 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.

ℹ️ No critical issues — minor suggestions inline.

Reviewed changes

  • Create-time assignee picker — new IssueAssigneeField wired into IssueDialog, offering Automatic / Assign to me / user search via JiraUserPicker.fixedOptions.
  • buildJiraCreateSubmission — merges the picked assignee into customFields and names user-typed keys in userFieldKeys only when a value is present, keeping Automatic creates compatible with older remote hosts.
  • getJiraSelfUser — site-scoped "me" resolution (stored site identity wins; viewer only stands in for the active/single site), with unit coverage.
  • State & reset plumbing — newJiraIssueAssignee added and reset on provider change, project/issue-type switch, create, and dialog close; assignee treated as a system create field; userFieldKeys added to the preload arg type; en locale keys synced.

ℹ️ Nitpicks

  • The JiraUserPicker doc comment now sits above the new JiraUserPickerFixedOption type (src/renderer/src/components/jira-user-picker.tsx:41-50), so it documents the type alias rather than the component. Move the type above the comment (or repeat the doc on the component).
  • On a remote host without the jira.user-fields.v1 capability the picker still offers "Assign to me" (self resolution reads connection status, not search) and it only fails at create with the update-required message.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog 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.

ℹ️ No critical issues — minor suggestions inline.

Reviewed changes

  • Create-time assignee picker — new IssueAssigneeField wired into IssueDialog, offering Automatic / Assign to me / user search via JiraUserPicker.fixedOptions.
  • buildJiraCreateSubmission — merges the picked assignee into customFields and names user-typed keys in userFieldKeys only when a value is present, keeping Automatic creates compatible with older remote hosts.
  • getJiraSelfUser — site-scoped "me" resolution (stored site identity wins; viewer only stands in for the active/single site), with unit coverage.
  • State & reset plumbing — newJiraIssueAssignee added and reset on provider change, project/issue-type switch, create, and dialog close; assignee treated as a system create field; userFieldKeys added to the preload arg type; en locale keys synced.

ℹ️ Nitpicks

  • The JiraUserPicker doc comment now sits above the new JiraUserPickerFixedOption type (src/renderer/src/components/jira-user-picker.tsx:41-50), so it documents the type alias rather than the component. Move the type above the comment (or repeat the doc on the component).
  • On a remote host without the jira.user-fields.v1 capability the picker still offers "Assign to me" (self resolution reads connection status, not search) and it only fails at create with the update-required message.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

… or anyone

The new-issue dialog gains an Assignee picker: Automatic (Jira applies the
project's default assignee), one-click "Assign to me" resolved from the
target site's stored identity, or any user via search. The selection resets
with the custom field values on project/type switches, since account ids
are site-scoped.

Creates now also send userFieldKeys, so the host shapes user-typed values
into the {accountId}/{name} refs Jira requires — previously the dialog
never passed them and user create fields were sent as bare strings. Keys
are only named when a value is present, keeping older remote hosts without
the user-fields capability working for assignee-less creates.

Co-Authored-By: Claude Fable 5 <[email protected]>
@kazuki-hanai
kazuki-hanai force-pushed the kazuki-hanai/jira-create-assignee branch from 3f22893 to 2a6661e Compare October 2, 2026 06:32
…, per-site picker remount, keep assignee across type changes

- Search the create dialog's assignee picker against /user/assignable/search?project=…
  (new listAssignableUsersForProject, IPC split into jira-user-search.ts for the
  max-lines budget); remote environment targets fall back to the existing
  site-wide search since older hosts have no such RPC
- Remount the picker per target project so cached results from the previous
  project or site cannot be selected after a switch
- Reset the picked assignee on project selection (account ids are site-scoped)
  instead of on every create-fields reload, so issue-type changes keep it
- Hide the assignee field and omit it from the payload when the target create
  screen does not accept an assignee — Jira rejects fields absent from the screen

Co-Authored-By: Claude Fable 5 <[email protected]>
@kazuki-hanai

Copy link
Copy Markdown
Contributor Author

Addressed the review in 139e54b:

  • Previous-site users remain selectable (greptile P1 / CodeRabbit major): the picker is now remounted via a key derived from the project selection (project + site), dropping cached results on any project switch. Keyed per project rather than per site because the search is now project-scoped (next point), so same-site project switches must not retain unassignable results either.
  • Unassignable users appear in search (greptile P1): added listAssignableUsersForProject (GET /user/assignable/search?project=…, Cloud query / Server-DC username param, sharing the existing assignable-search helper) with IPC + preload + runtime client; the create dialog's picker now searches project-assignable users only. Remote environment targets fall back to the existing site-wide search — no new RPC, so older hosts keep working (wire compatibility). Tests cover both param shapes.
  • Issue type clears assignee (greptile P2): the reset moved out of the create-fields effect into the project-select handler, so switching project (which can change site) drops the pick while issue-type changes keep it. use-task-page-jira-creation-metadata.ts is back to exactly its upstream state.
  • Validate assignee against create metadata (CodeRabbit): the Assignee field only renders when the create screen actually has an assignee field (hasJiraAssigneeCreateField), and submission includes the assignee only under the same check, so a stale pick can never be sent to a screen without that field.

Note: "Assign to me" can still name a user who is not assignable in rare project configurations; Jira's create error surfaces through the existing toast, same as other server-side validation.

🤖 Generated with Claude Code

@pullfrog pullfrog 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.

Important

The create-time assignee picker sends the numeric project id as Jira's project query parameter. Jira Cloud accepts a project id or key there, but Jira Server/Data Center documents project as the project key only, so the assignee search degrades on Server/DC.

Reviewed changes

  • Extracted the jira:* user-search IPC handlers into jira-user-search.ts and threaded a new listAssignableUsersForProject through main, preload, and the runtime client (environment targets fall back to the site-wide search).
  • Added a searchUsers override to JiraUserPicker so the create dialog can use the project-scoped assignable search while other callers keep /user/search.
  • Added hasJiraAssigneeCreateField and buildJiraCreateSubmission, hiding the picker and omitting the assignee when the create screen does not accept the field.
  • Moved the assignee reset from the create-fields effect to the explicit project-select handler (issue-type changes now keep the pick) and remount the picker per project to drop stale search results.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@kazuki-hanai

Copy link
Copy Markdown
Contributor Author

@greptileai review

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@nwparker

nwparker commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Visual proof for 8ee75aa72643d1114e34b2e62a7da43e6015a64c.

Captured on macOS in a hidden Electron renderer via Playwright CDP, using the real dialog, picker, and selection hook with fixture Jira users. These are component interaction checks; no live Jira issue was created and full application/backend integration is not claimed.

Before (main):
Before

After (Automatic):
After

Picker and selected user:
Picker
Selected user

Playwright exercised Assign to me, searching for Grace Hopper, choosing that user, and returning to Automatic; each resulting trigger label was asserted.

@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


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2651343b-26c7-4323-9bd8-0ebc739d2526
📥 Commits

Reviewing files that changed from the base of the PR and between 139e54b and bf4e62f.

📒 Files selected for processing (12)
  • src/main/jira/jira-issue-create-metadata.ts
  • src/renderer/src/components/jira-self-user.test.ts
  • src/renderer/src/components/jira-self-user.ts
  • src/renderer/src/components/task-page-jira-create-fields.ts
  • src/renderer/src/components/task-page/jira/IssueAssigneeField.test.tsx
  • src/renderer/src/components/task-page/jira/IssueAssigneeField.tsx
  • src/renderer/src/components/use-jira-create-assignee.test.tsx
  • src/renderer/src/components/use-jira-create-assignee.ts
  • src/renderer/src/components/use-task-page-jira-creation-projects.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/runtime/runtime-jira-client.test.ts
  • src/renderer/src/runtime/runtime-jira-user-fields-client.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/i18n/locales/en.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

Since the prior pullfrog review (139e54b), three commits landed:

  • Project-key assignable search — the create-time picker now sends the Jira project key (newJiraIssueTargetProject.key), which both Cloud and Server/Data Center accept, instead of the numeric project id. This resolves the prior Server/DC degradation finding, and the test now asserts the key reaches jiraListAssignableUsersForProject.
  • Provider-scoped "Assign to me" — the option is hidden unless the loaded status belongs to the current provider (jiraStatusCurrent), and hasJiraStatusChanged now deep-compares the viewer and each site (via shallow) plus activeSiteId and credentialProtection. checkJiraConnection now takes the jiraStatusUpdate path whenever the context key changes, so a provider switch replaces the status snapshot instead of reusing the previous host's viewer. This also clears the open coderabbit finding on the same line.
  • Hook-confirmation rename — the local callback in worktree-creation-hook-preparation.ts is renamed confirm → confirmHook (inherited-main CI repair for the localization scanner; behavior unchanged).

The assignee state reset, project-keyed picker remount, and submission gating all interact correctly with the new current-provider gate: a stale viewer can no longer be selected, and the new jira-connection-identity tests fail against the previous detection logic.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@nwparker
nwparker merged commit fa180a9 into stablyai:main Oct 5, 2026
30 checks passed
nwparker added a commit that referenced this pull request Oct 5, 2026
Preserve the six qualified metadata changes and include the existing localization repair from #24376.
brennanb2025 added a commit that referenced this pull request Oct 5, 2026
…25579)

The paired web client has no Jira preload, so window.api.jira.status()
resolves undefined from the fallback proxy. Since #24376 the first status
check stored that undefined and the sidebar crashed reading `.connected`.
Parse the status reply at the runtime-client boundary so every reader
gets a well-formed JiraConnectionStatus.
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