Repository navigation
Closed
Labels
Awaiting PaymentAuto-added when associated PR is deployed to productionExternalAdded to denote the issue can be worked on by a contributorNewFeatureSomething to build that is a new item.ReviewingHas a PR in reviewWeeklyKSv2
Description
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Expected Result:
- Go to workspaces page
- Press the
...menu on a workspace - Press Duplicate Workspace
- Enter the workspace name
- Press Next
- On this screen there should be a new checkbox to copy "Merchant Rules" under the checkbox for "Rules"
- The subtitle of that checkbox should be "N merchant rules" where N is the number of merchant coding rules
- Press Continue
- Press Proceed on the dialog
- Ensure the workspace was duplicated
- If the Merchant Rules checkbox was selected, and there are merchant coding rules in the original workspace, the merchant rules should be present in the new workspace
- If the Merchant Rules checkbox was selected, and there are no merchant coding rules in the original workspace, or if the Merchant Rules checkbox was not selected, there should be no merchant coding rules in the new workspace
Here are the steps Cursor suggested - note that this will require backend changes for it to work
- Add translation strings
In src/languages/en.ts, add to the duplicateWorkspace section (around line 5485):
duplicateWorkspace: {
// ... existing keys ...
merchantRules: 'Merchant rules',
merchantRulesCount: ({count}: {count: number}) => `${count} merchant ${count === 1 ? 'rule' : 'rules'}`,
},Add corresponding translations in all other language files (es.ts, fr.ts, de.ts, it.ts, ja.ts, nl.ts, pl.ts, pt-BR.ts, zh-hans.ts).
- Update WorkspaceDuplicateSelectFeaturesForm.tsx
In src/pages/workspace/duplicate/WorkspaceDuplicateSelectFeaturesForm.tsx
a) Import isEmptyObject if not already imported:
import {isEmptyObject} from '@src/types/utils/EmptyObject';b) Add a variable to count coding rules (around line 56):
const codingRulesCount = Object.keys(policy?.rules?.codingRules ?? {}).length;c) Add a new item to the items array (around line 136, after the rules item):
codingRulesCount > 0 && !isCollect
? {
translation: translate('workspace.duplicateWorkspace.merchantRules'),
value: 'codingRules',
alternateText: translate('workspace.duplicateWorkspace.merchantRulesCount', {count: codingRulesCount}),
}
: undefined,d) Update the parts object in confirmDuplicate (around line 223) to add the new key:
parts: {
// ... existing parts ...
codingRules: selectedItems.includes('codingRules'),
},e) Add codingRulesCount to the dependencies array of items useMemo (around line 186).
Screenshots/Videos
cc @JmillsExpensify @JS00001 @luacmartins
Issue Owner
Current Issue Owner: @Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022019136503061610055
- Upwork Job ID: 2019136503061610055
- Last Price Increase: 2026-02-04
- Automatic offers:
- situchan | Reviewer | 110349053
Issue Owner
Current Issue Owner: @Issue Owner
Current Issue Owner: @JmillsExpensifyMetadata
Metadata
Labels
Awaiting PaymentAuto-added when associated PR is deployed to productionExternalAdded to denote the issue can be worked on by a contributorNewFeatureSomething to build that is a new item.ReviewingHas a PR in reviewWeeklyKSv2
Activity
melvin-bot commentedon Feb 4, 2026
Triggered auto assignment to @dylanexpensify (
NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO. Remember to draft any necessary HelpDot updates by following the instructions here.melvin-bot commentedon Feb 4, 2026
Triggered auto assignment to Design team member for new feature review - @shawnborton (
NewFeature)nyomanjyotisa commentedon Feb 4, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
Feature: Ensure workspace merchant coding rules are copied to new workspace when duplicating workspaces
What is the root cause of that problem?
The duplicate workspace feature doesn't include merchant coding rules in the list of features to copy. The
itemsarray inWorkspaceDuplicateSelectFeaturesFormdoesn't include a checkbox for merchant rules, and thepartsobject passed toduplicateWorkspaceActiondoesn't includecodingRules.App/src/pages/workspace/duplicate/WorkspaceDuplicateSelectFeaturesForm.tsx
Lines 77 to 191 in ae1c091
App/src/pages/workspace/duplicate/WorkspaceDuplicateSelectFeaturesForm.tsx
Lines 223 to 238 in ae1c091
What changes do you think we should make in order to solve the problem?
Add translation strings for merchant rules in the
duplicateWorkspacesection:App/src/languages/en.ts
Lines 5487 to 5499 in ae1c091
Calculate the coding rules count after the other counts:
App/src/pages/workspace/duplicate/WorkspaceDuplicateSelectFeaturesForm.tsx
Lines 43 to 45 in ae1c091
Add a merchant rules item to the
itemsarray after the rules item:App/src/pages/workspace/duplicate/WorkspaceDuplicateSelectFeaturesForm.tsx
Lines 136 to 144 in ae1c091
Add
codingRulesto thepartsobject inconfirmDuplicate:App/src/pages/workspace/duplicate/WorkspaceDuplicateSelectFeaturesForm.tsx
Lines 223 to 238 in ae1c091
Add
codingRulesCountto theitemsuseMemo dependency array:App/src/pages/workspace/duplicate/WorkspaceDuplicateSelectFeaturesForm.tsx
Lines 176 to 191 in ae1c091
Add
isCodingRulesOptionSelectedflag inbuildDuplicatePolicyData:App/src/libs/actions/Policy/Policy.ts
Lines 2848 to 2860 in ae1c091
Conditionally exclude
codingRulesfrom therulesobject in the optimistic data:App/src/libs/actions/Policy/Policy.ts
Lines 2895 to 2902 in ae1c091
Note: This solution requires backend changes (
DuplicatePolicy). The frontend changes only handle the UI and optimistic dataWhat alternative solutions did you explore? (Optional)
None
26 remaining items
melvin-bot commentedon Feb 21, 2026
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
JmillsExpensify commentedon Mar 3, 2026
@situchan no payment is required on this one, right?
situchan commentedon Mar 4, 2026
This was made External and contributor should be paid.
JmillsExpensify commentedon Mar 4, 2026
Payment summary: $250 @nyomanjyotisa via New Expensify.
trjExpensify commentedon May 29, 2026
approved $250 for @nyomanjyotisa