Automation flow fails to create work item due to Assets custom field error
Platform Notice: Cloud Only - This article only applies to Atlassian apps on the cloud platform.
Summary
During a new work item creation within an automation flow, 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 flow 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 the AQL used in the automation and in the field
This behavior has been observed with various automation triggers and primarily impacts the Create work item action. During the automation ticket 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 flow 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
Compare the AQL used by the Automation Create work item action with the AQL/schema filtering configured on the Assets custom field. The object selected by Automation must be valid for the field’s configured filter.
If multiple objects are returned, adding further filtering to the AQL query that the automation flow 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.
Verify the fix
Run the AQL independently in Assets and confirm it returns only objects valid for the target custom field.
Run the Automation flow in a test case.
Confirm the Create work item action completes without a validation error.
Confirm the Assets custom field on the created work item contains the intended object.
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?