[$175] Reports - New report defaults to the default workspace instead of the selected workspace
If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.
Version Number: 9.5.52-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://github.com/Expensify/App/pull/106464 Email or phone of affected tester (no customers): n/a Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.5.1 Safari/Chrome, iPhone 13 iOS 26.6 App Component: Money Requests
Action Performed:
- Navigate to https://staging.new.expensify.com
- Create two workspaces, each with at least two open reports
- Navigate to the non-default workspace
- Click the + button > Create expense > Manual
- Click the Report field.
Expected Result:
The new report should be created in the selected non-default workspace, since expense creation was initiated from that workspace
Actual Result:
Unable to create a new report in a non-default workspace during expense creation. The flow redirects to the default workspace.
Workaround:
Unknown
Platforms:
- [ ] Android: App
- [ ] Android: mWeb Chrome
- [x] iOS: App
- [ ] iOS: mWeb Safari
- [ ] iOS: mWeb Chrome
- [x] Windows: Chrome
- [x] MacOS: Chrome Safari
Screenshots/Videos
https://github.com/user-attachments/assets/e9fae3b7-bcbd-4fb5-82be-6a5c63343b71
Applause Internal Information Exported by: Chandana Kiran Bug ID: 7320932
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022124410898921742791
- Upwork Job ID: 2124410898921742791
- Last Price Increase: 2026-11-22
While Applause doesn't embed attachments for this bug, here are the links for quick view: https://platform.applause.com/services/links/v1/external/c17e224ea12389f0c4e8531a10537aff4d1e35e2e232feb46a251616af90c304
Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 (External)
Job added to Upwork: https://www.upwork.com/jobs/~022124410898921742791
🤖 Web test steps verification results: ❌ fail
Reproduced from non-default Workspace B’s chat composer + menu: the expense starts in B, but selecting Create report switches it to default Workspace A. No expense was submitted.

| Step | Status |
|---|---|
Navigate into Workspace B without changing the defaultWorkspace A remained the default; B’s expense chat contained two open report cards. |
✅ |
Open + → Create expense → ManualUsed B’s chat composer menu, not the global sidebar button. The form initially showed Workspace B. |
✅ |
Report picker preserves Workspace B contextExisting reports belonged to B, but Create report displayed Workspace A.![]() |
❌ |
Selecting Create report retains Workspace BThe form switched to Workspace A. Persisted report ownership was not independently verified.![]() |
❌ |
Proposal
What is the root cause of that problem?
The Report picker discards the expense’s workspace when the selected report belongs to the current user and the expense is not per diem. This causes Create report to fall back to the saved default workspace—even though the expense and existing-report options correctly identify the non-default workspace.
Code evidence and alternative explanations
- useReportPickerActions.ts:182–210 extracts the transaction’s workspace but passes
undefinedas the target policy for an ordinary expense owned by the current user. - usePolicyForMovingExpenses.ts:135–149 then selects the default workspace without requiring workspace selection.
- useReportPickerActions.ts:261–278 uses that resolved workspace to create the report.
The initial-context-loss hypothesis does not explain this reproduction: the manual form and existing-report options retained B until Create report was selected. The frontend fallback explains the observed switch without requiring a backend redirect.
Scope: Verified on development web through the chat composer. The global sidebar + entry point was not verified; it should not be conflated with this flow. No introducing PR was established.
What changes do you think we should make in order to solve the problem?
Preserve the explicit workspace-chat destination when creating a new report for a non-global expense. Do not discard it solely because the selected report belongs to the current user.
Keep global-create defaults, editing behavior, per-diem handling, other-owner handling, and workspace restrictions intact.
Regression coverage
With A default and B non-default, each containing two open reports:
- Start a manual expense from B’s chat.
- Verify existing reports and Create report target B.
- Verify creation sends B’s policy ID.
- Cover both dropdown and full-page pickers.
- Retest global creation, per diem, other-owner expenses, and restricted workspaces.
What alternative solutions did you explore? (Optional)
Changing the saved default workspace would mask the bug rather than preserve the expense’s existing workspace context.
Related issue: Consolidate the default-workspace eligibility rule across report and expense flows concerns overlapping fallback logic, but is not a confirmed duplicate.
Next Steps for Contributor+ team:
To accept: @MelvinBot implement this to create a draft PR.
To refine: @MelvinBot <your feedback>
To reject: Explain why you are rejecting Melvin's proposal.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When I create an expense from a non-default workspace and pick Create report in the Report field, the new report goes to my default workspace instead of the workspace I started the expense in.
What is the root cause of that problem?
The report picker decides where Create report goes with usePolicyForMovingExpenses. It passes targetExpensePolicyID as the preferred workspace:
https://github.com/Expensify/App/blob/5de42f69e315de80aee82d2fdf01b283034ea8b6/src/pages/iou/request/step/IOURequestStepReport/hooks/useReportPickerActions.ts#L196-L210
targetExpensePolicyID is only set when the expense belongs to another user or is per diem. For my own regular expense it is always undefined, even when I'm creating the expense inside a specific workspace chat (transactionPolicyID, the workspace of the chat I started in, is already computed on L196 but not used here).
With no expensePolicyID, usePolicyForMovingExpenses falls back to the active/default workspace:
https://github.com/Expensify/App/blob/5de42f69e315de80aee82d2fdf01b283034ea8b6/src/hooks/usePolicyForMovingExpenses.ts#L127-L143
So policyForMovingExpenses is the default workspace, and createReportForPolicy builds the optimistic report on that policy (https://github.com/Expensify/App/blob/5de42f69e315de80aee82d2fdf01b283034ea8b6/src/pages/iou/request/step/IOURequestStepReport/hooks/useReportPickerActions.ts#L261-L276). Then handleRegularReportSelection moves the draft expense onto that new report, so the expense also switches to the default workspace. The list already uses the chat's workspace when creating an expense (selectedPolicyID, https://github.com/Expensify/App/blob/5de42f69e315de80aee82d2fdf01b283034ea8b6/src/pages/iou/request/step/IOURequestStepReport/hooks/useReportPickerActions.ts#L311-L316), which is why the existing reports shown are from the right workspace but Create report isn't.
The comment there says "fall back to undefined to let the default workspace apply". That makes sense when moving an existing expense, but not when the expense is being created from a chosen workspace chat.
What changes do you think we should make in order to solve the problem?
In useReportPickerActions, when we're creating an expense (action === CREATE) and its participant is a workspace chat, pass that workspace (transactionPolicyID) to usePolicyForMovingExpenses as the preferred policy. Keep the current behavior for editing/moving existing expenses (still default workspace) and for other users' and per diem expenses.
usePolicyForMovingExpenses already checks that the preferred policy is valid (member, can create expenses, group policy, not pending delete, time tracking for time requests). If it isn't valid, it still falls back to the default workspace, so we don't add a new edge case.
The empty-report confirmation and the restricted-action check already use policyForMovingExpenses, so they follow the right workspace automatically.
What specific scenarios should we test?
- Two workspaces, A default. From workspace B's chat: + > Create expense > Manual > Report > Create report. The report and the expense stay in B (web, iOS, Mac).
- The same from workspace A still creates in A.
- Editing an existing expense's report and choosing Create report keeps the current behavior.
- Per diem, time and managed-card expenses are unchanged.
- If I start in a workspace where I can't create expenses, it falls back to the default workspace as it does today.
- Add a unit test in
tests/ui/components/IOURequestStepReportNewReportTest.tsxcovering a non-default workspace chat.
What alternative solutions did you explore? (Optional)
Using reportOrDraftReport?.policyID (the same source as selectedPolicyID) as the preferred policy for the create flow, so the list and Create report always use the same workspace.
Contributor details
Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01be5d412b545fdf18
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Proposal
What is the root cause of that problem?
In src/pages/iou/request/step/IOURequestStepReport/hooks/useReportPickerActions.ts (lines 196–210), targetExpensePolicyID determines which workspace Create report targets (both for creating the report in createReportForPolicy at lines 261–279 and for displaying the workspace subtitle on the Create report row via transactionPolicyID: targetExpensePolicyID at line 328 → IOURequestEditReportCommon.tsx:169).
Currently, line 201 only populates targetExpensePolicyID when ownerAccountID !== session?.accountID || isPerDiemTransaction, otherwise setting it to undefined:
- When a workspace has no open reports yet,
selectedReportisundefined, soownerAccountIDisundefinedandownerAccountID !== session?.accountIDaccidentally evaluates totrue, preservingtransactionPolicyID. - When the non-default workspace has open reports (as in the repro steps),
selectedReportresolves to an open report owned by the current user (ownerAccountID === session?.accountID), so line 201 flips tofalseand discards the originating workspace (targetExpensePolicyID = undefined). - Passing
undefinedtousePolicyForMovingExpenses(src/hooks/usePolicyForMovingExpenses.ts:135–142) skips the preferredvalidExpensePolicyIDbranch and falls back toactivePolicy(the user's default workspace). Meanwhile,selectedPolicyIDat line 315 explicitly preservesreportOrDraftReport?.policyID ?? transactionPolicyIDwhen!isEditing && !isFromGlobalCreate, which is why the picker lists Workspace B's existing reports while Create report targets default Workspace A and moves the draft expense there.
What changes do you think we should make in order to solve the problem?
In src/pages/iou/request/step/IOURequestStepReport/hooks/useReportPickerActions.ts:
- Preserve the originating workspace during non-global expense creation:
- Extend the
targetExpensePolicyIDcondition at line 201 to also apply when creating a non-global expense (isCreateReport && !isFromGlobalCreate), resolvingselectedReport?.policyID ?? reportOrDraftReport?.policyID ?? transactionPolicyID(aligned withselectedPolicyIDat line 315 so both the existing-report list and Create report always use the same originating workspace, including whenreportIDFromRouteis a generated ID or a workspace chat/report). - Keep
!isFromGlobalCreatein the guard so Global Create (+sidebar button, whereselectedPolicyIDis intentionallyundefinedto list reports across all workspaces and allow default/workspace-picker resolution viashouldSelectPolicy) is unaffected. - Keep
isEditing, per-diem, time, managed-card, and other-owner flows untouched. - Because
targetExpensePolicyIDfeeds bothusePolicyForMovingExpenses(line 208) andlistProps.transactionPolicyID(line 328 →IOURequestEditReportCommon.tsx:169), both the Create report row subtitle, restriction check (createReport), empty-report confirmation, andcreateReportForPolicyautomatically target the originating non-default workspace across both the anchored dropdown and full-page report picker.
- Extend the
- Add regression unit tests in
tests/ui/components/IOURequestStepReportNewReportTest.tsx:- With Workspace A as default (
activePolicyID) and Workspace B non-default (both containing open reports), open the Report picker while creating a manual expense in Workspace B's chat (isFromGlobalCreate: false) and assert that Create report displays and creates the new report on Workspace B (policyID: B) rather than Workspace A. - Verify Global Create (
isFromGlobalCreate: true) and editing an existing expense (action: EDIT) preserve their existing fallback behavior.
- With Workspace A as default (
What alternative solutions did you explore? (Optional)
- Passing
transactionPolicyIDfor allaction === CREATEflows without checking!isFromGlobalCreate: Rejected because in Global Create (isFromGlobalCreate: true),selectedPolicyIDis intentionallyundefinedso the picker spans all workspaces andCreate reportrespects the default workspace /shouldSelectPolicyworkspace selector flow. - Passing
selectedPolicyIDdirectly intousePolicyForMovingExpenses: Rejected because for editing another user's expense (isEditing === trueandownerAccountID !== session?.accountID),selectedPolicyIDisundefined, whereastargetExpensePolicyIDmust still preserveselectedReport?.policyID ?? transactionPolicyID.
Contributor details: Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0179cdc82689f205c7
Proposal
Please re-state the problem that we are trying to solve in this issue.
When initiating expense creation from a non-default workspace (Workspace B) with existing open reports and tapping on the Report field, selecting Create report creates the new report in the default workspace (Workspace A) instead of retaining the selected originating workspace (Workspace B).
What is the root cause of that problem?
In src/pages/iou/request/step/IOURequestStepReport/hooks/useReportPickerActions.ts (lines 196–210 & 315–328):
- The Report picker correctly filters existing reports to Workspace B because line 315 preserves the originating policy:
selectedPolicyID = !isEditing && !isFromGlobalCreate ? (reportOrDraftReport?.policyID ?? transactionPolicyID) : undefined;
- However, line 201 calculates
targetExpensePolicyID:
const targetExpensePolicyID = ownerAccountID !== session?.accountID || isPerDiemTransaction ? (selectedReport?.policyID ?? transactionPolicyID) : undefined;
For a user's own manual expense in a non-default workspace with open reports, selectedReport resolves to the user's existing open report (ownerAccountID === session?.accountID), so ownerAccountID !== session?.accountID is false. Consequently, targetExpensePolicyID is set to undefined.
targetExpensePolicyIDis passed intousePolicyForMovingExpenses(line 208) andlistProps.transactionPolicyID(line 328): WhentargetExpensePolicyIDisundefined,usePolicyForMovingExpensesfalls back toactivePolicy(the user's saved default workspace, Workspace A).- Therefore, the Create report action (and its subtitle) targets Workspace A instead of the active workspace (Workspace B) where expense creation was initiated.
What changes do you think we should make in order to solve the problem?
In src/pages/iou/request/step/IOURequestStepReport/hooks/useReportPickerActions.ts:
Update targetExpensePolicyID (line 201) to preserve the originating policy during non-global expense creation (!isFromGlobalCreate && !isEditing / isCreateReport):
const originatingPolicyID = selectedReport?.policyID ?? reportOrDraftReport?.policyID ?? transactionPolicyID;
const targetExpensePolicyID =
(!isFromGlobalCreate && !isEditing) || ownerAccountID !== session?.accountID || isPerDiemTransaction
? originatingPolicyID
: undefined;
This guarantees that:
- Non-global expense creation initiated from a specific workspace chat or report retains that workspace for Create report.
- Global Create (
isFromGlobalCreate === true, via+in global LHN) continues to passundefined, allowing standard default workspace resolution (shouldSelectPolicy). - Other-owner expenses and per-diem transactions continue to work as expected.
- Both
usePolicyForMovingExpensesandlistProps.transactionPolicyIDreceive the consistent originatingpolicyID.
What alternative solutions did you explore? (Optional)
- Unconditionally setting
targetExpensePolicyID = originatingPolicyID: Suboptimal because global create (isFromGlobalCreate) intentionally needsundefinedto allow workspace selection. Checking!isFromGlobalCreateensures global create flows remain intact.
