diff --git a/x-pack/plugins/cases/server/telemetry/queries/cases.ts b/x-pack/plugins/cases/server/telemetry/queries/cases.ts index a918089cbe0e6..0e999721ae105 100644 --- a/x-pack/plugins/cases/server/telemetry/queries/cases.ts +++ b/x-pack/plugins/cases/server/telemetry/queries/cases.ts @@ -57,9 +57,9 @@ export const getLatestCasesDates = async ({ ]); return { - createdAt: savedObjects?.[0]?.saved_objects?.[0]?.attributes?.created_at ?? null, - updatedAt: savedObjects?.[1]?.saved_objects?.[0]?.attributes?.updated_at ?? null, - closedAt: savedObjects?.[2]?.saved_objects?.[0]?.attributes?.closed_at ?? null, + createdAt: savedObjects?.[0]?.saved_objects?.[0]?.attributes?.created_at ?? '', + updatedAt: savedObjects?.[1]?.saved_objects?.[0]?.attributes?.updated_at ?? '', + closedAt: savedObjects?.[2]?.saved_objects?.[0]?.attributes?.closed_at ?? '', }; }; diff --git a/x-pack/plugins/cases/server/telemetry/queries/utils.ts b/x-pack/plugins/cases/server/telemetry/queries/utils.ts index 43b5149e6333d..0c0a4f7bbf87d 100644 --- a/x-pack/plugins/cases/server/telemetry/queries/utils.ts +++ b/x-pack/plugins/cases/server/telemetry/queries/utils.ts @@ -16,7 +16,6 @@ import { import type { CaseAggregationResult, Buckets, - CasesTelemetry, MaxBucketOnCaseAggregation, SolutionTelemetry, AttachmentFramework, @@ -320,89 +319,6 @@ export const getOnlyConnectorsFilter = () => type: CASE_USER_ACTION_SAVED_OBJECT, }); -export const getTelemetryDataEmptyState = (): CasesTelemetry => ({ - cases: { - all: { - assignees: { - total: 0, - totalWithZero: 0, - totalWithAtLeastOne: 0, - }, - total: 0, - monthly: 0, - weekly: 0, - daily: 0, - status: { - open: 0, - inProgress: 0, - closed: 0, - }, - syncAlertsOn: 0, - syncAlertsOff: 0, - totalUsers: 0, - totalParticipants: 0, - totalTags: 0, - totalWithAlerts: 0, - totalWithConnectors: 0, - latestDates: { - createdAt: null, - updatedAt: null, - closedAt: null, - }, - ...emptyAttachmentFramework(), - }, - sec: { - total: 0, - monthly: 0, - weekly: 0, - daily: 0, - assignees: { total: 0, totalWithAtLeastOne: 0, totalWithZero: 0 }, - ...emptyAttachmentFramework(), - }, - obs: { - total: 0, - monthly: 0, - weekly: 0, - daily: 0, - assignees: { total: 0, totalWithAtLeastOne: 0, totalWithZero: 0 }, - ...emptyAttachmentFramework(), - }, - main: { - total: 0, - monthly: 0, - weekly: 0, - daily: 0, - assignees: { total: 0, totalWithAtLeastOne: 0, totalWithZero: 0 }, - ...emptyAttachmentFramework(), - }, - }, - userActions: { all: { total: 0, monthly: 0, weekly: 0, daily: 0, maxOnACase: 0 } }, - comments: { all: { total: 0, monthly: 0, weekly: 0, daily: 0, maxOnACase: 0 } }, - alerts: { all: { total: 0, monthly: 0, weekly: 0, daily: 0, maxOnACase: 0 } }, - connectors: { - all: { - all: { totalAttached: 0 }, - itsm: { totalAttached: 0 }, - sir: { totalAttached: 0 }, - jira: { totalAttached: 0 }, - resilient: { totalAttached: 0 }, - swimlane: { totalAttached: 0 }, - maxAttachedToACase: 0, - }, - }, - pushes: { - all: { total: 0, maxOnACase: 0 }, - }, - configuration: { - all: { - closure: { - manually: 0, - automatic: 0, - }, - }, - }, -}); - const emptyAttachmentFramework = (): AttachmentFramework => ({ attachmentFramework: { persistableAttachments: [], diff --git a/x-pack/plugins/cases/server/telemetry/types.ts b/x-pack/plugins/cases/server/telemetry/types.ts index 5a3f03d4dc691..e28c3abaf4d52 100644 --- a/x-pack/plugins/cases/server/telemetry/types.ts +++ b/x-pack/plugins/cases/server/telemetry/types.ts @@ -139,9 +139,9 @@ export interface Status { } export interface LatestDates { - createdAt: string | null; - updatedAt: string | null; - closedAt: string | null; + createdAt: string; + updatedAt: string; + closedAt: string; } export interface CasesTelemetry {