From 909cf7ef2fd2eb2daab48cb081646576f9cfc6e9 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 16 Feb 2026 11:58:14 +0530 Subject: [PATCH] Replace HelpScout customFields IDs with semantic metaFields Move all HelpScout field ID references out of frontend API calls. All GROWTH_ENDPOINT calls now use metaFields with named keys (category, orgId, severity, etc.) instead of customFields with raw HelpScout IDs. The backend handles the ID mapping. --- src/lib/stores/feedback.ts | 18 +++--------------- .../settings/BAAModal.svelte | 10 ++++------ .../settings/Soc2Modal.svelte | 10 ++++------ src/routes/(console)/supportWizard.svelte | 16 ++++++++-------- 4 files changed, 19 insertions(+), 35 deletions(-) diff --git a/src/lib/stores/feedback.ts b/src/lib/stores/feedback.ts index 8b140c0ca1..49b3516471 100644 --- a/src/lib/stores/feedback.ts +++ b/src/lib/stores/feedback.ts @@ -105,8 +105,6 @@ function createFeedbackStore() { return feedback; }); }, - // TODO: update growth server to accept `billingPlan`. - // TODO: update growth server to accept `source` key to know the feedback source area. submitFeedback: async ( subject: string, message: string, @@ -122,18 +120,6 @@ function createFeedbackStore() { if (!VARS.GROWTH_ENDPOINT) return; trackEvent(Submit.FeedbackSubmit); - const customFields: Array<{ id: string; value: string | number }> = [ - { id: '47364', value: currentPage } - ]; - - if (value) { - customFields.push({ id: '40655', value }); - } - - if (billingPlan) { - customFields.push({ id: '56109', value: billingPlan }); - } - const response = await fetch(`${VARS.GROWTH_ENDPOINT}/feedback`, { method: 'POST', headers: { @@ -143,9 +129,11 @@ function createFeedbackStore() { subject, message, email, - customFields, firstname: (name || 'Unknown').slice(0, 40), metaFields: { + currentPage, + npsScore: value, + billingPlan, source: get(feedback).source, orgId, projectId, diff --git a/src/routes/(console)/organization-[organization]/settings/BAAModal.svelte b/src/routes/(console)/organization-[organization]/settings/BAAModal.svelte index a6835a9c01..1aaccfef2a 100644 --- a/src/routes/(console)/organization-[organization]/settings/BAAModal.svelte +++ b/src/routes/(console)/organization-[organization]/settings/BAAModal.svelte @@ -67,13 +67,11 @@ firstName: ($user?.name ?? '').slice(0, 40), message: `BAA request for ${$organization?.name ?? ''} (${$organization?.$id ?? ''})`, tags: ['cloud'], - customFields: [ - { id: '41612', value: 'BAA' }, - { id: '48493', value: $user?.name ?? '' }, - { id: '48492', value: $organization?.$id ?? '' }, - { id: '48490', value: $user?.$id ?? '' } - ], metaFields: { + category: 'BAA', + userName: $user?.name ?? '', + orgId: $organization?.$id ?? '', + userId: $user?.$id ?? '', employees: employees, country: country, role: role, diff --git a/src/routes/(console)/organization-[organization]/settings/Soc2Modal.svelte b/src/routes/(console)/organization-[organization]/settings/Soc2Modal.svelte index bce0634a3e..c4b3b645d1 100644 --- a/src/routes/(console)/organization-[organization]/settings/Soc2Modal.svelte +++ b/src/routes/(console)/organization-[organization]/settings/Soc2Modal.svelte @@ -68,13 +68,11 @@ firstName: ($user?.name ?? '').slice(0, 40), message: `SOC-2 request for ${$organization?.name ?? ''} (${$organization?.$id ?? ''})`, tags: ['cloud'], - customFields: [ - { id: '41612', value: 'SOC-2' }, - { id: '48493', value: $user?.name ?? '' }, - { id: '48492', value: $organization?.$id ?? '' }, - { id: '48490', value: $user?.$id ?? '' } - ], metaFields: { + category: 'SOC-2', + userName: $user?.name ?? '', + orgId: $organization?.$id ?? '', + userId: $user?.$id ?? '', employees: employees, country: country, role: role, diff --git a/src/routes/(console)/supportWizard.svelte b/src/routes/(console)/supportWizard.svelte index b253385210..f3ada26846 100644 --- a/src/routes/(console)/supportWizard.svelte +++ b/src/routes/(console)/supportWizard.svelte @@ -136,14 +136,14 @@ formData.append('message', $supportData.message); formData.append('tags[]', categoryTopicTag); formData.append( - 'customFields', - JSON.stringify([ - { id: '41612', value: $supportData.category }, - { id: '48492', value: $organization?.$id ?? '' }, - { id: '48491', value: $supportData?.project ?? '' }, - { id: '56023', value: $supportData?.severity ?? '' }, - { id: '56024', value: $organization?.billingPlanId ?? '' } - ]) + 'metaFields', + JSON.stringify({ + category: $supportData.category, + orgId: $organization?.$id ?? '', + projectId: $supportData?.project ?? '', + severity: $supportData?.severity ?? '', + billingPlan: $organization?.billingPlanId ?? '' + }) ); if (files && files.length > 0) { formData.append('attachment', files[0]);