Automation rule fails to create issue due to an Assets custom field validation error
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
During a new work item creation within an automation rule, the Create work item event fails with the error Validation failed for Insight object (customfield_12345).
Diagnosis
When creating a new work that includes an Assets custom field, the rule does not execute correctly, and the audit log entry returns a Some Errors status. The error seen in the automation audit logs:
Error creating issue
Validation failed for Insight object (customfield_12345)
Cause
Mismatch between AQL used in the automation and in the field
This behavior has been seen with various automation triggers and primarily impacts the Create issue action. During the automation issue creation event, the Assets custom field is attempted to be populated using an AQL query, however, editing the field fails due to a validation error, resulting in the overall event to fail.
The issue occurs due to a mismatch error when multiple Assets Objects are returned on the AQL used to set the field value. When the Assets custom field has Schema filtering configured and the automation rule tries to set the value to an Object that does not match the filter, a validation error occurs.
Solution
Match the automation and the field's AQL
Adding further filtering to the AQL query that the automation rule is executing resolves the issue as it filters out those Objects that would not validate against the Assets custom field.
An example may be to add filtering for objectSchema, objectSchemaId, objectType, or objectTypeId.
Please read the support article Set up the Assets objects custom field for further information on configuring Assets custom fields and Using Assets Query Language (AQL) syntax for examples and details on the AQL syntax.
Was this helpful?