diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/MentionReportRenderer.tsx b/src/components/HTMLEngineProvider/HTMLRenderers/MentionReportRenderer.tsx
index 52377fa20b4d..345bd338f365 100644
--- a/src/components/HTMLEngineProvider/HTMLRenderers/MentionReportRenderer.tsx
+++ b/src/components/HTMLEngineProvider/HTMLRenderers/MentionReportRenderer.tsx
@@ -11,7 +11,6 @@ import useCurrentReportID from '@hooks/useCurrentReportID';
import useStyleUtils from '@hooks/useStyleUtils';
import useThemeStyles from '@hooks/useThemeStyles';
import {getReport} from '@libs/ReportUtils';
-import * as ReportUtils from '@libs/ReportUtils';
import Navigation from '@navigation/Navigation';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
@@ -37,7 +36,7 @@ const getMentionDetails = (htmlAttributeReportID: string, currentReport: OnyxEnt
if (!isEmpty(htmlAttributeReportID)) {
const report = getReport(htmlAttributeReportID);
- reportID = report?.reportID ?? undefined;
+ reportID = report?.reportID ?? htmlAttributeReportID;
mentionDisplayText = removeLeadingLTRAndHash(report?.reportName ?? report?.displayName ?? htmlAttributeReportID);
// Get mention details from name inside tnode
} else if ('data' in tnode && !isEmptyObject(tnode.data)) {
@@ -63,7 +62,9 @@ function MentionReportRenderer({style, tnode, TDefaultRenderer, reports, ...defa
const currentReportID = useCurrentReportID();
const currentReport = getReport(currentReportID?.currentReportID);
- const isGroupPolicyReport = useMemo(() => (currentReport && !isEmptyObject(currentReport) ? ReportUtils.isGroupPolicy(currentReport) : false), [currentReport]);
+
+ // When we invite someone to a room they don't have the policy object, but we still want them to be able to see and click on report mentions, so we only check if the policyID in the report is from a workspace
+ const isGroupPolicyReport = useMemo(() => currentReport && !isEmptyObject(currentReport) && !!currentReport.policyID && currentReport.policyID !== CONST.POLICY.ID_FAKE, [currentReport]);
const mentionDetails = getMentionDetails(htmlAttributeReportID, currentReport, reports, tnode);
if (!mentionDetails) {
diff --git a/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx b/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx
index b9b9025bb02b..75d0c703b5b1 100644
--- a/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx
+++ b/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx
@@ -342,7 +342,8 @@ function ReportActionCompose({
[],
);
- const isGroupPolicyReport = useMemo(() => ReportUtils.isGroupPolicy(report), [report]);
+ // When we invite someone to a room they don't have the policy object, but we still want them to be able to mention other reports they are members of, so we only check if the policyID in the report is from a workspace
+ const isGroupPolicyReport = useMemo(() => !!report?.policyID && report.policyID !== CONST.POLICY.ID_FAKE, [report]);
const reportRecipientAcountIDs = ReportUtils.getReportRecipientAccountIDs(report, currentUserPersonalDetails.accountID);
const reportRecipient = personalDetails[reportRecipientAcountIDs[0]];
const shouldUseFocusedColor = !isBlockedFromConcierge && !disabled && isFocused;