[$175] TriNet - Missing Final Approver when user select Custom Approval
If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.
Version Number: v9.5.7-0 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://test-management.browserstack.com/projects/2219752/folder/49506715/test-cases/112855922 Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause Internal Team Bug source: Regression TC Execution Device used: Web App Component: Other
Action Performed:
Precondition: account connected to TriNet
- Open the link www.staging.new.expensify.com
- Logged in [email protected]
- Go to Approval mode >> Select Manager Approval >> Click modal "Change approval mode"
- Wait for the sync to finish
- Verify the "Final approver" is displayed
- Go to Approval mode >> Select Custom Approval >> Click modal "Change approval mode"
- Wait for the sync to finish
- Verify the "Final approver" is displayed
Expected Result:
the "Final approver" is should be displayed when user select approval mode "Custom approval"
Actual Result:
the "Final approver" is NOT displayed when user select approval mode "Custom approval" Note: not able to check on IOS due to no latest build
Workaround:
Unknown
Platforms:
- [ ] Android: App
- [ ] Android: mWeb Chrome
- [ ] iOS: App
- [ ] iOS: mWeb Safari
- [ ] iOS: mWeb Chrome
- [x] Windows: Chrome
- [ ] MacOS: Chrome Safari
Screenshots/Videos
Applause Internal Information Exported by: Svetlana Lazutkina Bug ID: 7282879
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022109655010878713688
- Upwork Job ID: 2109655010878713688
- Last Price Increase: 2026-10-12
While Applause doesn't embed attachments for this bug, here are the links for quick view: https://platform.applause.com/services/links/v1/external/09b4065e8ebef94a12a81d07de1b7f55f75644c62087124801750e180c4be0a0
https://platform.applause.com/services/links/v1/external/204442339f46465af11e55161db473473f88bbe71348016b7e3219c44c1b6a83
Issue Analysis
Root Cause: This is expected behavior, not a bug. [Payment due @mkhutornyi] Keep approval workflow rules working with HR integrations (merged 2026-10-06) hides the Final approver row on purpose when the approval mode is Custom. In Custom mode, the HR connection sets no approvers, so there is no final approver to show (src/pages/workspace/hr/utils.ts:214-227).
Recommended Fix: No code change. Update the regression test case (BrowserStack TC 112855922) so step 8 checks that Final approver is not shown in Custom approval. Then close this issue.
Investigation details
- The TriNet card is built from
STATIC_HR_PROVIDERS(key: 'zenefits').getHRCardsreturns nofinalApproverrow whengetHRApprovalMode(...) === CONST.ZENEFITS.APPROVAL_MODE.CUSTOM. Gusto and Merge HR follow the same rule (utils.ts:263-276). - The change came in commit
6a5a59e("Hide final approver in custom approval mode") in that PR. The PR's QA steps say: "Verify the Gusto card shows no Final approver row. (new)".tests/unit/HrUtilsTest.tscovers it too. - The help site agrees. Custom Approval means "approval workflows are managed manually in Expensify" (
TriNet.md:68,TriNet.md:81). In this mode, an admin sets the approvers on the Workflows page. - Steps 3–5 (Manager approval shows Final approver) still pass. Only step 8 conflicts with the new design.
Next Steps: Reply with @MelvinBot <your feedback> if you think Final approver should still show in Custom approval.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ZhenjaHorbach (External)
Job added to Upwork: https://www.upwork.com/jobs/~022109655010878713688
Proposal
What is the root cause of that problem?
Every place that shows the HR final approver only checks for Manager mode, so Custom mode never gets it. getHRAdvancedModeFinalApprover returns the final approver only when approvalMode === MANAGER, so getWorkflowsFromPolicy (and the matching builder further down) never appends the final approver to the approver chain in Custom mode.
https://github.com/Expensify/App/blob/6502fece05b0fc79e99ba6781c5f919c665aba9f/src/libs/merge/HRUtils.ts#L175-L187
https://github.com/Expensify/App/blob/6502fece05b0fc79e99ba6781c5f919c665aba9f/src/libs/WorkflowUtils.ts#L281-L291
isHRAdvancedMode is also true only for Manager mode, and WorkflowsApprovalsTab passes isHRAdvancedMode and hrFinalApproverEmail (only when advanced) to ApprovalWorkflowSection.
https://github.com/Expensify/App/blob/6502fece05b0fc79e99ba6781c5f919c665aba9f/src/libs/merge/HRUtils.ts#L166-L173
https://github.com/Expensify/App/blob/6502fece05b0fc79e99ba6781c5f919c665aba9f/src/pages/workspace/workflows/tabs/WorkflowsApprovalsTab.tsx#L424-L426
In approverTitle, the "Final approver" title is only reached inside if (isHRAdvancedMode), so Custom mode falls through to the generic "Approver" / "1st approver" titles.
https://github.com/Expensify/App/blob/6502fece05b0fc79e99ba6781c5f919c665aba9f/src/components/ApprovalWorkflowSection.tsx#L74-L83
What changes do you think we should make in order to solve the problem?
- In
HRUtils.ts, makegetHRAdvancedModeFinalApproverreturn the configuredfinalApproverfor Manager and Custom modes for Gusto, Zenefits and Merge HR. Basic mode is already covered bygetHRFinalApprover. - Add a small helper, e.g.
isHRFinalApproverMode(policy), true for Manager or Custom, and use it inWorkflowsApprovalsTabto decide whether to passhrFinalApproverEmail. KeepisHRAdvancedModeunchanged, because it also drives the manager-chain labels and other behaviour. - In
ApprovalWorkflowSection.approverTitle, check the final-approver match before theisHRAdvancedModebranch, so the last approver gets "Final approver" wheneverhrFinalApproverEmailis set. The "Manager" label stays Manager-mode only. - Check that the Custom mode workflows still render and edit as they do now (via
isAnyHRReadOnlyWorkflowMode) after the final approver is appended. - Unit tests: add a Zenefits Custom-mode case to the
WorkflowUtilstests (final approver appended to the chain) and one to theHRUtilstests. Add anApprovalWorkflowSectiontest that the last approver is titled "Final approver" in Custom mode.
What alternative solutions did you explore? (Optional)
- Show the label in
ApprovalWorkflowSectiononly, without changing the workflow data. This fails when the final approver is not already in the chain, since the row would not exist. - Always show the final approver in every HR mode. This would also change Basic and Optional behaviour that nobody asked for.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On a TriNet connected workspace, the Final approver row disappears from the HR > TriNet card as soon as the approval mode is switched to Custom approval.
What is the root cause of that problem?
The TriNet card rows are built in getHRCards. Since commit 6a5a59e (PR #102750), the Final approver row is only added when the approval mode is not Custom. In Custom mode finalApproverRows is just an empty array, so the card renders only the Approval mode row:
https://github.com/Expensify/App/blob/7e2c443f97b6548d5c8b806f2c209a7a64138853/src/pages/workspace/hr/utils.ts#L214-L227
The Merge HR loop has the same gate, so BambooHR etc. behave the same way:
https://github.com/Expensify/App/blob/7e2c443f97b6548d5c8b806f2c209a7a64138853/src/pages/workspace/hr/utils.ts#L263-L276
The stored value is not lost. config.finalApprover stays on the connection after the switch (the unit test even sets finalApprover: '[email protected]' in Custom mode), and the final approver page and updateZenefitsFinalApprover don't check the mode at all. Only the row that leads to them is removed, so the admin can't see or reach the setting in Custom mode.
What changes do you think we should make in order to solve the problem?
- In
getHRCards, drop theisCustomApprovalcheck and always add the Final approver row for connected cards, in both the static provider loop (Gusto / TriNet) and the Merge HR loop. To avoid keeping two copies, move the row into one small helper used by both loops:
function getFinalApproverRow(config, route, ...) : MergeProviderConfigRow {
return {
field: 'finalApprover',
description: translate('workspace.merge.finalApprover'),
title: getMergeFinalApproverDisplayName(config?.finalApprover, policyEmployeePersonalDetails, translate, formatPhoneNumber),
route,
pendingAction: config?.pendingFields?.finalApprover,
errors: config?.errorFields?.finalApprover,
};
}
configRows: [approvalModeRow, getFinalApproverRow(config, provider.finalApproverRoute.getRoute(policyID), ...)]
-
Nothing changes on the Approval mode page. Switching to Custom still keeps the workspace approval workflows (the
shouldDeleteApprovalWorkflowRuleslogic stays as is), we only stop hiding the row. -
Tests: flip the existing case in
HrUtilsTest.tsso it asserts the Final approver row is returned for Gusto, TriNet and Merge HR in Custom mode with the stored approver as its title. Also add a case that the row keeps the right route and pending/error fields after switching from Manager to Custom.
https://github.com/Expensify/App/blob/7e2c443f97b6548d5c8b806f2c209a7a64138853/tests/unit/HrUtilsTest.ts#L909-L925
What alternative solutions did you explore? (Optional)
- Hiding the row in Custom mode looks deliberate (the comment says the connection sets no approvers in Custom). If the team wants to keep that, no code change is needed. We'd just update step 8 of the regression test case (TC 112855922) to check that Final approver is not shown in Custom approval.
- Keep the row in Custom mode but make it read-only with a hint that approvals are managed on the Workflows tab. That keeps the stored value visible without suggesting it affects routing.
Proposal
Please re-state the problem that we are trying to solve in this issue.
In a TriNet-connected workspace, the Final approver configuration row disappears from the HR TriNet settings card when the workspace approval mode is switched to Custom approval.
What is the root cause of that problem?
In src/pages/workspace/hr/utils.ts#L214-L227, getHRCards builds the configuration rows for connected HR providers. It deliberately restricts finalApproverRows so they are only included when !isCustomApproval:
const finalApproverRows: MergeProviderConfigRow[] = !isCustomApproval && provider.finalApproverRoute
? [{
field: 'finalApprover',
description: translate('workspace.merge.finalApprover'),
title: getMergeFinalApproverDisplayName(config?.finalApprover, policyEmployeePersonalDetails, translate, formatPhoneNumber),
route: provider.finalApproverRoute.getRoute(policyID),
pendingAction: config?.pendingFields?.finalApprover,
errors: config?.errorFields?.finalApprover,
}]
: [];
The exact same condition exists in the Merge HR loop (lines 263–276).
However, config.finalApprover remains persisted in Onyx, and the underlying backend and final approver pages continue to operate normally. Hiding the row completely prevents administrators from inspecting, configuring, or updating their TriNet final approver while on Custom approval mode.
What changes do you think we should make in order to solve the problem?
- In
src/pages/workspace/hr/utils.tswithingetHRCards, remove the!isCustomApprovalrestriction so thatfinalApproverRowsis always created whenprovider.finalApproverRouteis available. - Deduplicate the row builder by extracting a shared helper function
getFinalApproverConfigRow(...)used by both the static HR provider block and the dynamic Merge HR provider loop. - Update unit tests in
tests/unit/HrUtilsTest.tsto verify thatfinalApproverrow is included in the returned config rows for Gusto, TriNet, and Merge HR cards even whenisCustomApprovalis true.
What alternative solutions did you explore? (Optional)
- Making the row visible but disabled in Custom mode: unnecessary since updating the final approver on the destination page is valid and doesn't conflict with custom rules.
@ZhenjaHorbach Whoops! This issue is 2 days overdue. Let's get this updated quick!
@ZhenjaHorbach 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
@ZhenjaHorbach Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!
@ZhenjaHorbach 10 days overdue. I'm getting more depressed than Marvin.
@ZhenjaHorbach this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
This issue has not been updated in over 14 days. @ZhenjaHorbach eroding to Weekly issue.
Issue Analysis
Root Cause: This is expected behavior, not a bug. [Payment due @mkhutornyi] Keep approval workflow rules working with HR integrations (merged 2026-10-06) hides the Final approver row on purpose when the approval mode is Custom. In Custom mode, the HR connection sets no approvers, so there is no final approver to show (
src/pages/workspace/hr/utils.ts:214-227).Recommended Fix: No code change. Update the regression test case (BrowserStack TC 112855922) so step 8 checks that Final approver is not shown in Custom approval. Then close this issue.
Investigation details
- The TriNet card is built from
STATIC_HR_PROVIDERS(key: 'zenefits').getHRCardsreturns nofinalApproverrow whengetHRApprovalMode(...) === CONST.ZENEFITS.APPROVAL_MODE.CUSTOM. Gusto and Merge HR follow the same rule (utils.ts:263-276).- The change came in commit
6a5a59e("Hide final approver in custom approval mode") in that PR. The PR's QA steps say: "Verify the Gusto card shows no Final approver row. (new)".tests/unit/HrUtilsTest.tscovers it too.- The help site agrees. Custom Approval means "approval workflows are managed manually in Expensify" (
TriNet.md:68,TriNet.md:81). In this mode, an admin sets the approvers on the Workflows page.- Steps 3–5 (Manager approval shows Final approver) still pass. Only step 8 conflicts with the new design.
Next Steps: Reply with
@MelvinBot <your feedback>if you think Final approver should still show in Custom approval.
@Gonals @trjExpensify Can you confirm this, please? And if it's correct Let's close this!
@ZhenjaHorbach Whoops! This issue is 2 days overdue. Let's get this updated quick!
@ZhenjaHorbach Whoops! This issue is 2 days overdue. Let's get this updated quick!
@ZhenjaHorbach Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@ZhenjaHorbach Whoops! This issue is 2 days overdue. Let's get this updated quick!
Not overdue
Issue Analysis
Root Cause: This is expected behavior, not a bug. [Payment due @mkhutornyi] Keep approval workflow rules working with HR integrations (merged 2026-10-06) hides the Final approver row on purpose when the approval mode is Custom. In Custom mode, the HR connection sets no approvers, so there is no final approver to show (
src/pages/workspace/hr/utils.ts:214-227). Recommended Fix: No code change. Update the regression test case (BrowserStack TC 112855922) so step 8 checks that Final approver is not shown in Custom approval. Then close this issue. Investigation details
- The TriNet card is built from
STATIC_HR_PROVIDERS(key: 'zenefits').getHRCardsreturns nofinalApproverrow whengetHRApprovalMode(...) === CONST.ZENEFITS.APPROVAL_MODE.CUSTOM. Gusto and Merge HR follow the same rule (utils.ts:263-276).- The change came in commit
6a5a59e("Hide final approver in custom approval mode") in that PR. The PR's QA steps say: "Verify the Gusto card shows no Final approver row. (new)".tests/unit/HrUtilsTest.tscovers it too.- The help site agrees. Custom Approval means "approval workflows are managed manually in Expensify" (
TriNet.md:68,TriNet.md:81). In this mode, an admin sets the approvers on the Workflows page.- Steps 3–5 (Manager approval shows Final approver) still pass. Only step 8 conflicts with the new design.
Next Steps: Reply with
@MelvinBot <your feedback>if you think Final approver should still show in Custom approval. view run@Gonals @trjExpensify Can you confirm this, please? And if it's correct Let's close this!
CC: @Gonals @trjExpensify