diff --git a/src/cdk/v2/destinations/intercom/config.js b/src/cdk/v2/destinations/intercom/config.js index 96b7abd280..164e7d593d 100644 --- a/src/cdk/v2/destinations/intercom/config.js +++ b/src/cdk/v2/destinations/intercom/config.js @@ -20,6 +20,7 @@ const ReservedUserAttributes = [ 'firstname', 'createdAt', 'timestamp', + 'lastSeenAt', 'originalTimestamp', 'unsubscribedFromEmails', ]; diff --git a/src/cdk/v2/destinations/intercom/procWorkflow.yaml b/src/cdk/v2/destinations/intercom/procWorkflow.yaml index 0452faf431..c74d2f71ff 100644 --- a/src/cdk/v2/destinations/intercom/procWorkflow.yaml +++ b/src/cdk/v2/destinations/intercom/procWorkflow.yaml @@ -55,7 +55,7 @@ steps: email: {{{{$.getGenericPaths("email")}}}}, phone: {{{{$.getGenericPaths("phone")}}}}, avatar: {{{{$.getGenericPaths("avatar")}}}}, - last_seen_at: $.toSeconds({{{{$.getGenericPaths("timestamp")}}}}), + last_seen_at: $.toSeconds(.context.traits.lastSeenAt), role: .traits.role || .context.traits.role, signed_up_at: $.toSeconds(.traits.createdAt || .context.traits.createdAt), owner_id: .traits.ownerId || .context.traits.ownerId ? Number(.traits.ownerId || .context.traits.ownerId) : undefined, diff --git a/test/integrations/destinations/intercom/processor/data.ts b/test/integrations/destinations/intercom/processor/data.ts index e8dedcf6ec..490d6bcbf6 100644 --- a/test/integrations/destinations/intercom/processor/data.ts +++ b/test/integrations/destinations/intercom/processor/data.ts @@ -231,6 +231,7 @@ export const data = [ lastName: 'Rudderlabs', address: 'california usa', ownerId: '13', + lastSeenAt: '2023-11-10T14:42:44.724Z', }, }, type: 'identify', @@ -267,7 +268,7 @@ export const data = [ JSON: { email: 'test@rudderlabs.com', external_id: 'user@1', - last_seen_at: 1700628164, + last_seen_at: 1699627364, name: 'Test Rudderlabs', owner_id: 13, phone: '+91 9999999999', @@ -358,7 +359,6 @@ export const data = [ JSON: { email: 'test+2@rudderlabs.com', external_id: 'user@2', - last_seen_at: 1700628164, name: 'Test RudderStack', owner_id: 14, phone: '+91 9299999999', diff --git a/test/integrations/destinations/intercom/router/data.ts b/test/integrations/destinations/intercom/router/data.ts index f7c5942703..2fc9f34d70 100644 --- a/test/integrations/destinations/intercom/router/data.ts +++ b/test/integrations/destinations/intercom/router/data.ts @@ -22,6 +22,7 @@ export const data = [ lastName: 'Rudderlabs', address: 'california usa', ownerId: '13', + lastSeenAt: '2023-11-10T14:42:44.724Z', }, }, type: 'identify', @@ -191,7 +192,7 @@ export const data = [ JSON: { email: 'test@rudderlabs.com', external_id: 'user@1', - last_seen_at: 1700628164, + last_seen_at: 1699627364, name: 'Test Rudderlabs', owner_id: 13, phone: '+91 9999999999',