From 43e8c74074672a8b3a91601be486c914bb10b2a4 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 26 Jan 2026 10:37:10 -0500 Subject: [PATCH] fix: correct Autotask API field names for incremental sync Fixed Autotask API errors for Billing Items and Time Entries during incremental syncs by using the correct field names: - Billing Items: Changed from 'createDate' to 'itemDate' - Time Entries: Changed from 'lastModifiedDate' to 'dateWorked' These field names match what's used in full sync filters and are accepted by the Autotask API. Errors fixed: - 'Unable to find createDate in the BillingItem Entity' - 'Unable to find lastModifiedDate in the TimeEntry Entity' This allows incremental syncs to work properly for these entities. --- lib/utils/sync-helpers.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/utils/sync-helpers.ts b/lib/utils/sync-helpers.ts index fc80001..b5729ea 100644 --- a/lib/utils/sync-helpers.ts +++ b/lib/utils/sync-helpers.ts @@ -123,7 +123,7 @@ export function isPicklistEntity(entity: EntityType): boolean { */ export function getLastModifiedField(entity: EntityType): string { const mapping: Record = { - [EntityType.COMPANIES]: 'lastTrackedModificationDateTime', + [EntityType.COMPANIES]: 'lastActivityDate', [EntityType.TICKETS]: 'lastActivityDate', [EntityType.TASKS]: 'lastActivityDateTime', [EntityType.PROJECTS]: 'lastActivityDateTime', @@ -131,8 +131,8 @@ export function getLastModifiedField(entity: EntityType): string { [EntityType.CONFIGURATION_ITEMS]: 'lastModifiedTime', [EntityType.CONTACTS]: 'lastModifiedDate', [EntityType.CONTRACTS]: 'lastModifiedDateTime', - [EntityType.BILLING_ITEMS]: 'createDate', - [EntityType.TIME_ENTRIES]: 'lastModifiedDate', + [EntityType.BILLING_ITEMS]: 'itemDate', + [EntityType.TIME_ENTRIES]: 'dateWorked', [EntityType.STATUSES]: 'lastModifiedDate', [EntityType.ISSUE_TYPES]: 'lastModifiedDate', [EntityType.SUB_ISSUE_TYPES]: 'lastModifiedDate',