diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index ff8d366c2bf0..e28af2e6e439 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -3231,6 +3231,9 @@ function completeOnboarding( const isAccountIDOdd = AccountUtils.isAccountIDOddNumber(currentUserAccountID ?? 0); const targetEmail = isAccountIDOdd ? CONST.EMAIL.NOTIFICATIONS : CONST.EMAIL.CONCIERGE; + // If the target report isn't opened, the permission field will not exist. So we should add the fallback permission for task report + const fallbackPermission = isAccountIDOdd ? [CONST.REPORT.PERMISSIONS.READ] : [CONST.REPORT.PERMISSIONS.READ, CONST.REPORT.PERMISSIONS.WRITE]; + const actorAccountID = PersonalDetailsUtils.getAccountIDsByLogins([targetEmail])[0]; const targetChatReport = ReportUtils.getChatByParticipants([actorAccountID, currentUserAccountID]); const {reportID: targetChatReportID = '', policyID: targetChatPolicyID = ''} = targetChatReport ?? {}; @@ -3346,7 +3349,7 @@ function completeOnboarding( }, isOptimisticReport: true, managerID: currentUserAccountID, - permissions: targetChatReport?.permissions, + permissions: targetChatReport?.permissions ?? fallbackPermission, }, }, {