Repository navigation
fix(jira): shape user-typed create fields and seed reporter with viewer - #17456
Conversation
- Jira rejects a bare string for reporter/user-picker fields on issue
create, so shape customFields values into {accountId}/{name} objects
for keys the caller flags via userFieldKeys.
- Seed required user fields with the authenticated viewer by default
and add a searchable user picker (jira.searchUsers) so users aren't
forced into free text for reporter/custom user fields.
Greptile SummaryThe PR shapes Jira create-screen user fields into deployment-specific user references, adds user search across local and remote runtime boundaries, and renders scalar user fields with a searchable picker. The follow-up changes also restrict automatic viewer seeding to the reporter field and prevent seeding when the target project belongs to another known site.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| src/renderer/src/components/task-page/hooks/use-task-page-jira-create-dialog.tsx | Restricts viewer seeding to the reporter field, checks site identity, and resets user selection state across dialog targets. |
| src/main/jira/jira-issue-mutations.ts | Shapes explicitly identified scalar and array user-field values for Cloud or Server/DC before issue creation. |
| src/main/jira/jira-issue-create-metadata.ts | Adds deployment-aware Jira user search with authentication handling and request-queue cleanup. |
| src/renderer/src/components/jira-user-picker.tsx | Adds a debounced searchable single-user picker with stale-result suppression. |
| src/main/runtime/rpc/methods/jira.ts | Extends the runtime contract with optional user-field keys and the Jira user-search method. |
| src/shared/jira-types.ts | Adds the optional cross-boundary declaration identifying custom fields that contain Jira user IDs. |
Sequence Diagram
sequenceDiagram
participant U as User
participant UI as Jira create dialog
participant C as Runtime Jira client
participant H as Local or remote host
participant J as Jira API
U->>UI: Open user picker
UI->>C: searchUsers(query, siteId)
C->>H: IPC or jira.searchUsers RPC
H->>J: GET /user/search
J-->>H: Jira users
H-->>UI: Normalized user options
U->>UI: Select user and submit
UI->>H: createIssue(customFields, userFieldKeys)
H->>H: Shape IDs as accountId or name
H->>J: Create issue
Reviews (2): Last reviewed commit: "fix(jira): scope reporter seed and keep ..." | Re-trigger Greptile
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (15)
🚧 Files skipped from review as they are similar to previous changes (10)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughAdds Jira user search through the Jira client, runtime RPC, IPC, preload, and renderer layers. Adds searchable user pickers for Jira issue fields and assignee selection. Seeds the reporter field with the authenticated viewer when the site matches. Shapes user field values as Merge Risk: 🟡 Moderate · up to This PR fixes Jira person-field formatting and adds user search, but required multi-person fields still cannot be submitted correctly, and reporter prefill can use an identity from the wrong Jira site in some multi-site configurations. Older remote hosts may also show an empty user picker, so the PR is not merge-ready until these compatibility and correctness risks are addressed or explicitly accepted. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description covers the required sections, links issue Full details: Linked Issues checkExplanation The changes address issue Full details: Out of Scope Changes checkExplanation The changes remain focused on Jira user-field creation support. IPC, RPC, runtime, renderer, metadata, assignee refactoring, tests, and documentation updates directly support the linked issue objectives. Full details: Docstring CoverageExplanation Docstring coverage is 70.59% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 34 functions across 19 files. (1 skipped: 1 too large.)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: e1ab4645-dc48-4c4b-8971-737b769bd278
📒 Files selected for processing (22)
src/main/ipc/jira.tssrc/main/jira/issues.test.tssrc/main/jira/issues.tssrc/main/jira/jira-issue-create-metadata.tssrc/main/jira/jira-issue-mutations.test.tssrc/main/jira/jira-issue-mutations.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/rpc/methods/jira.tssrc/preload/api/jira-api.tssrc/preload/index.tssrc/renderer/src/components/TaskPage.tsxsrc/renderer/src/components/jira-issue-workspace-chrome.tsxsrc/renderer/src/components/jira-user-picker.tsxsrc/renderer/src/components/task-page-jira-create-fields.test.tssrc/renderer/src/components/task-page-jira-create-fields.tssrc/renderer/src/components/task-page/dialogs/new-jira-issue-custom-fields.tsxsrc/renderer/src/components/task-page/dialogs/new-jira-issue-dialog.tsxsrc/renderer/src/components/task-page/hooks/use-task-page-create-jira-submit.tssrc/renderer/src/components/task-page/hooks/use-task-page-jira-create-dialog.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/runtime/runtime-jira-client.tssrc/shared/jira-types.ts
💤 Files with no reviewable changes (1)
- src/main/jira/issues.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
There was a problem hiding this comment.
Important
The host-side shaping and the reporter seed are solid, but the seeding is applied more broadly than it should be (it fills every required single-value user field, not just reporter), and required multi-user picker fields are now rendered as a single-select. See inline.
Reviewed changes
- Host-side user-field shaping —
userFieldRef()/toUserFieldValue()shape user-typed create fields into{ accountId }(Cloud) or{ name }(Server/DC) for the keys declared in the newuserFieldKeysargument;updateIssue()'s assignee branch now reusesuserFieldRef(). - User search — new
searchUsers()against/user/search(Cloudquery, Serverusernamewith a.wildcard fallback), wired through a newjira.searchUsersRPC method, IPC channel, preload binding, andruntime-jira-clientwrapper. - Reporter seed — the create dialog seeds required single-value user fields with the authenticated viewer once create-fields load, keeping a parallel
jiraUserFieldSelectionsmap for display names. - Renderer picker — new
jira-user-picker.tsxcombobox (250 ms debounce) andJiraUserOptionListextracted for the existing assignee popover.
ℹ️ New jira.searchUsers RPC method vs. older hosts
A newer client against an older remote host will get method_not_found for jira.searchUsers; the picker catches that and renders an empty list, so the dialog degrades gracefully rather than breaking. That matches the runtime-rpc behavior (an answer, not silence), so capability negotiation is not required here — this is the same graceful-degradation pattern already used by the search path. Just confirming the author's open question: the empty-list fallback is acceptable.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
… path Review follow-ups on the create-field shaping: - Seed only `reporter`. isVisibleJiraCreateField matches every required non-system field, so the previous filter also pre-filled required custom user pickers (Reviewer, Requested by) that Jira never defaults. - Skip the seed when the target project is on another site. The viewer comes from the active site, and the host shapes against the target's client, so a foreign accountId is rejected on Cloud and can silently resolve to a different person by username on Server/DC. - Render JiraUserPicker only for scalar user fields. It holds one user, so an array-of-user field collapsed to a single member; those keep the existing comma-separated text path, which still reaches toUserFieldValue's array branch. Adds docstrings across the touched Jira functions to satisfy the docstring-coverage pre-merge check. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01HdMzQN6T3jRVahCK2sNyur
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Three prior findings were resolved in 3547b0f, and the fixes are correct.
- Reporter-only seed — the create dialog now seeds only the
reporterfield (JIRA_REPORTER_FIELD_KEY), matching Jira's own create screen; other required user-picker fields stay empty for the user to fill. - Cross-site guard — seeding is skipped when the target project's
siteIddiffers fromjiraViewerSiteId(the active site's id), so a CloudaccountIdcan no longer be emitted as{ name }against a Server/DC target. - Array-of-user fields —
isJiraScalarUserCreateField()(scalartype === 'user'only) at the render site keeps multi-user fields on the comma-separated text path, andgetJiraUserCreateFieldKeys()still includes them so the host shapes each member. Unit tests cover all three cases. - Doc comments — added JSDoc to the new helpers and changed functions (formatting/documentation only, no behavior change).
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
OrcaWin
left a comment
There was a problem hiding this comment.
Reviewed the implementation end to end: Jira Cloud and Server/DC user shaping, scalar/array field handling, create metadata search, picker state, IPC/preload/runtime routing, and tests. The feature is correct and the automated checks are green. I also verified the remote-wire caveat around the new jira.searchUsers RPC; I am landing capability gating separately so older Orca hosts fail safely instead of silently presenting an unusable picker. Credit to @NiZZioN / Aldin Saracevic for the implementation.

ELI5
If a Jira project required a Reporter (or any other person-type field) on the create screen, creating the issue from Orca failed — Jira replied that the field was missing even though a value had been typed in. Jira does not accept a plain string for person fields; it wants a user object. This PR sends the right shape, pre-fills those fields with your own account the way Jira's own create screen does, and replaces the free-text box with a searchable user picker so you choose a real person instead of guessing at a name.
What Changed
Host (
src/main/jira/)jira-issue-mutations.ts: addeduserFieldRef()andtoUserFieldValue(). Values for user-typed fields are shaped into{ accountId }on Cloud and{ name }on Server/DC before they reach the create body; arrays are mapped member-wise. Only keys the caller flags via the newuserFieldKeysargument are shaped, so ordinary custom fields pass through untouched.updateIssue()'s existing assignee branch now reusesuserFieldRef()instead of repeating the Cloud/Server conditional inline.jira-issue-create-metadata.ts: addedsearchUsers()against/user/search. Cloud filters withquery, Server/DC withusername; because Server rejects an emptyusername, it falls back to the.wildcard it does accept. Auth errors clear the token and rethrow; anything else (typically a missing browse-users permission) warns and returns[]./user/assignable/searchvariant fits here: reporter and user-picker fields are not restricted to assignable users, and no issue key exists yet at create time.Wire / shared
JiraCreateIssueArgs.userFieldKeys?: string[]— optional, so a client that omits it keeps exactly the current behavior.jira.searchUsersRPC method plus thejira:searchUsersIPC channel, preload binding, andruntime-jira-clientwrapper (reusing the existing search-query length guard and 30s RPC timeout).Renderer
task-page-jira-create-fields.ts:isJiraUserCreateField()identifies user fields by schema (type === 'user', or anarrayofuser) — they carry noallowedValues, so without this they fell through to the free-text branch.getJiraUserCreateFieldKeys()collects the keys the host needs.jira-user-picker.tsx: popover + input combobox with a 250 ms debounce, backed byjira.searchUsers.use-task-page-jira-create-dialog.tsx: seeds single-value user fields with the authenticated viewer once create-fields load, mirroring Jira's own default-reporter behavior, and keeps a paralleljiraUserFieldSelectionsmap so the trigger renders a display name rather than a rawaccountId. Existing user edits win over the seed, and the map resets when the dialog closes or the target project changes.Why
Jira's create API rejects
"reporter": "<string>"and surfaces it as a missing field error, which made the failure hard to read — the field was visibly filled in. Shaping the value host-side keeps the Cloud/Server difference in one place (userFieldRef), which is also why the pre-existing assignee logic was folded into it rather than duplicated a third time.The shaping is opt-in per key rather than value-sniffed: the host cannot tell a user id from any other string, so the renderer — which has the field schema — declares which keys are user fields. Seeding the viewer means the common case (a required reporter that should just be you) needs no interaction at all, and the picker exists so the uncommon case does not require typing an opaque
accountId.Linked Issue
Fixes #17465
Visual Proof
BEFORE: (Freetext reporter field)

AFTER: (selectbox of x user)

Testing
Commands run locally on macOS against this branch:
pnpm lintpnpm typecheckpnpm test(changed areas:jira-issue-mutations,issues,task-page-jira-create-fields)pnpm buildNew tests in
src/main/jira/jira-issue-mutations.test.ts(189 lines) cover the create-body shaping: Cloud{accountId}vs Server{name}, array-valued user fields, keys not listed inuserFieldKeyspassing through unshaped, and empty/null values being dropped.task-page-jira-create-fields.test.tscovers user-field detection by schema, including thearray-of-usercase. The assignee-shaping assertions removed fromissues.test.tsmoved into the new file alongside the helper they now share.AI Disclosure
Claude Code (Claude Opus 5) was used while preparing this contribution. The author should state here how much of the implementation itself was AI-assisted.
Review
Agent review summary (Claude Opus 5), against the areas CONTRIBUTING asks contributors to check:
userFieldKeysis an optional field, so an older host simply ignores it and behaves as it does today — no crash, and the pre-existing bug remains until the host updates.jira.searchUsers, however, is a new RPC method: a newer client against an older host will get an unknown-method error. The picker catches the rejection and renders an empty list, so it degrades without breaking the dialog, but the user is then left with a picker that finds nobody. Perdocs/reference/remote-wire-compatibility.mda maintainer should confirm whether this needs capability negotiation, or whether the empty-list fallback is considered acceptable.accountIdvsname) and the search (queryvsusername, with the.wildcard for Server's rejection of an empty username). The Server path relies onmapUserstoring the username in theaccountIdslot, which is the existing convention in this module.maxResults=50, and goes through the existingacquire/releaserequest queue, so it cannot bypass Jira rate limiting. Seeding runs once per create-fields load. In-flight requests are cancelled via thecancelledflag on unmount and on query change.Popover/Inputprimitives and design tokens (hover:bg-accent,text-[12px],size-5 rounded-full); the avatar markup matches the established pattern inpr-reviewers-picker-row.tsx. New strings are routed throughtranslate()and added toen.json; other locales fall back to English, consistent with how new strings land in this repo (pnpm lint's localization coverage check passes).isAuthError→clearTokenpath. The only new external content isavatarUrlrendered into an<img src>, which matches existing Jira/GitHub/Linear avatar usage elsewhere in the renderer.Caveat: this review is static analysis of the diff. It was not exercised against a live Jira instance in the session that produced it.
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
See the Review section above for cross-platform, remote/SSH, performance, UI, and security notes. The one item a maintainer should actively rule on is the new
jira.searchUsersRPC method against older remote hosts.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)No need to shout me out, just mention @NiZZioN, i will be more than tankful 😄
Performance Measurement
No speed-up is claimed or measured; this adds correct Jira user-field handling. The picker waits 250 ms after the last query, cancels superseded timers, sends at most one search for each settled query, and requests at most 50 results. Payload shaping is one O(F) pass over custom fields, and issue creation remains one Jira request; no extra lookup occurs until the picker opens. No wall-clock benchmark was run.
User-Facing Trade-offs
User search now depends on Jira network access and browse-users permission; a denied or failed search yields no suggestions, and a required user field may block creation until a user can be selected. A newer client paired with an older host may receive an unknown
jira.searchUsersmethod and show an empty picker; the optionaluserFieldKeysfield otherwise preserves old-host behavior. Array-of-user fields intentionally remain text input until multi-select exists.