So I’m seeing a very odd bug with the genesyscloud_integration_action resource when deploying a custom Data Action for analytics aggregation via the Genesys Cloud Terraform provider. The resource fails during the apply phase with a 400 Bad Request. The error message from the API indicates a JSON schema validation failure on the transform property.
Environment details:
- Provider:
genesyscloud/genesyscloudv1.14.2 - Region:
us-east-1 - Terraform: v1.5.7
- Action Type:
analytics.reporting
The HCL snippet for the failing resource is below. The transform logic is straightforward JSONata. It pulls wrap_up_code and maps it to a static string. I have verified the JSONata syntax using the online validator and it passes. The issue seems specific to how the Terraform provider serializes the transform object or how the Genesys Cloud API parses it during creation.
resource "genesyscloud_integration_action" "analytics_export_action" {
enabled = true
name = "Analytics Wrap Up Mapper"
description = "Maps wrap up codes for reporting"
action_type = "analytics.reporting"
transform {
body = """
{
"wrapUpCategory": $switch(
$exists(wrap_up_code), wrap_up_code,
default, "Unknown"
)
}
"""
}
input {
body = """
{
"wrap_up_code": "{{data.wrapUpCode}}"
}
"""
}
}
The specific error returned is:
Error: API returned an error: 400 Bad Request
Message: Validation failed for field: transform. Error: Invalid JSONata expression or schema mismatch.
I have tried escaping the quotes differently and using heredoc syntax. I also attempted to deploy this same action via Postman using the raw JSON payload and it worked successfully. This suggests the issue is likely in the Terraform provider’s serialization of the transform block or a specific constraint in the CLI/Provider implementation for this resource type.
Has anyone else encountered this specific schema validation error with analytics.reporting actions in Terraform? Any workarounds or known issues with provider v1.14.2 regarding JSONata transforms?