Autotask icon

Autotask

Interact with Kaseya's Autotask PSA REST API to manage companies, tickets, contracts, and more.

Actions1078

Time Entry → Create If Not Exists

AI-generated

Summary

Creates a new time entry if no matching record exists based on specified duplicate-detection fields; otherwise, updates the existing record or returns it based on configuration.

Inputs

  • dedupFields — Fields used for duplicate detection. If empty, deduplication is skipped and a record is always created.
  • updateFields — Fields to compare against the duplicate. If values differ, the duplicate will be updated. Ignored when "Error on Duplicate" is enabled.
  • errorOnDuplicate — Whether to throw an error when a duplicate is found instead of returning the existing record.
  • fieldsToMap (required) — A resource mapper to define the Time Entry data structure and values to be sent to the Autotask API.

Output shape

One or more items representing the created or updated Time Entry(s).

When deduplication is enabled and a duplicate is found, the operation returns the existing record unless 'Error on Duplicate' is enabled.

Examples

Example 1: Create a new time entry for a resource if none exists for the same date and resource.

Set dedupFields to 'Date' and 'Resource ID'. Map the input data using 'fieldsToMap'.

Example 2: Update an existing time entry if the same Resource ID and Date combination exists.

Set dedupFields to 'Resource ID' and 'Date'. Set updateFields to 'Billable Hours' and 'Comments'.

Links

Discussion