Autotask icon

Autotask

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

Actions524

Contract → Create If Not Exists

AI-generated

Overview

This node operation for the 'Contract' resource with the 'Create If Not Exists' operation allows users to create a new contract in the Autotask PSA system only if a duplicate contract does not already exist based on specified deduplication fields. It is useful for avoiding duplicate contract entries while ensuring new contracts are added when necessary. For example, it can be used in automated workflows to add contracts from external systems without creating duplicates.

Use Case Examples

  1. Automatically create a contract in Autotask only if it doesn't already exist based on contract number or client ID.
  2. Update existing contract details if a duplicate is found and the update fields differ, or throw an error if duplicates are not allowed.

Properties

Name Meaning
Dedup Fields Names or IDs Fields used for duplicate detection. If empty, deduplication is skipped and a new contract is always created.
Update Fields Names or IDs Fields to compare against the duplicate contract. If values differ, the duplicate contract will be updated. Ignored if 'Error on Duplicate' is enabled.
Error On Duplicate Boolean flag to determine whether to throw an error when a duplicate contract is found instead of returning it.
Fields Mapping of contract fields to be created or updated in the operation.

Output

JSON

  • id - The unique identifier of the created or found contract.
  • fields - The contract fields data that were created or updated.
  • duplicateFound - Boolean indicating if a duplicate contract was found during the operation.

Dependencies

  • Requires an API key credential for Autotask PSA REST API authentication.

Troubleshooting

  • If the node throws an error about duplicate contracts, check the 'Error On Duplicate' setting and the deduplication fields configuration.
  • Ensure the API credentials are valid and have sufficient permissions to create or update contracts.
  • If no contracts are created or updated, verify that the deduplication fields and update fields are correctly specified and match the data structure in Autotask.

Links

Discussion