

# Amazon Connect Rules Function language
Rules Function language

This section describes the Amazon Connect Rules Function language. You can use it to add conditions to rules programmatically. The function language is a JSON-based representation of a series of rule conditions.

**Topics**
+ [Concepts](rules-language-concepts.md)
+ [Example rule function](example-rule-function.md)
+ [Conditions](rule-function-conditions.md)

# Concepts
Concepts

The following terms are used in the Rules Function language.

**Operator**  
A function that is used to evaluate Operands. The very top Operator has to be either AND or OR. 

**Operands**  
An array of objects that Operator is evaluating on. The length the array and the type of each object depends on the Operator defined on the same level.

**ComparisonValue**  
A JSON path string that specifies the value field the rule is comparing.

**FilterClause**  
An object that defines additional criteria that the rule is evaluating against. Depending on **ComparisonValue**, the value of this field varies.

**Negate**  
A Boolean value that indicates if negation should be applied to the operator.

# Example rule function in Amazon Connect Rule Function language
Example rule function

The following example shows a simple rule that would be evaluated to `true` if "refund" is mentioned by the customer who is in a specific queue. 

To learn how to use conditions correctly, we recommend creating a new rule in the Amazon Connect console, and then calling the [DescribeRule](https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribeRule.html) API for it.

```
{
  "Version": "2022-11-25", // A string representing the version of the rule. Currently the only supported version is 2022-11-25.
  "RuleFunction": { // RuleFunction object body
    "Operator": "AND",
    "Operands": [
      {
        "Operator": "CONTAINS_ANY",
        "Operands": [
          "refund"
        ],
        "ComparisonValue": "$.ContactLens.RealTimeCall.ExactMatch.Transcript",
        "FilterClause": {
          "LogicOperator": "AND",
          "Filters": [
            {
              "Type": "ParticipantRole",
              "Data": "CUSTOMER"
            }
          ]
        },
        "Negate": false // If Negate were set to true, it would mean the word "refund" was NOT mentioned
      },
      {
        "Operator": "CONTAINS_ANY",
        "Operands": [
          "11111111-1234-5678-9123-12345678012" // QueueId 
        ],
        "ComparisonValue": "$.ContactLens.RealTimeCall.Queue.QueueId",
        "Negate": false
      }
    ]
  }
}
```

# Conditions in Amazon Connect Rules Function language
Conditions

A rule function needs to start with either an AND or OR Operator. The Operands of AND or OR Operators is a list of conditions. Conditions vary depending on the TriggerEventSource.

Following are the conditions that you can use.

**Topics**
+ [

# OnMetricDataUpdate
](OnMetricDataUpdate.md)
+ [

# OnContactEvaluationSubmit
](OnContactEvaluationSubmit.md)
+ [

# OnPostCallAnalysisAvailable
](OnPostCallAnalysisAvailable.md)
+ [

# OnRealTimeCallAnalysisAvailable
](OnRealTimeCallAnalysisAvailable.md)
+ [

# OnPostChatAnalysisAvailable
](OnPostChatAnalysisAvailable.md)
+ [

# OnZendeskTicketCreate
](OnZendeskTicketCreate.md)
+ [

# OnZendeskTicketStatusUpdate
](OnZendeskTicketStatusUpdate.md)
+ [

# OnSalesforceCaseCreate
](OnSalesforceCaseCreate.md)
+ [

# OnCaseCreate
](OnCaseCreate.md)
+ [

# OnCaseUpdate
](OnCaseUpdate.md)
+ [

# OnSlaBreach
](OnSlaBreach.md)
+ [

# PatternMatch Operands
](patternmatch-operands.md)

# OnMetricDataUpdate


## Metric Data Update - Rule Conditions


**Parameters**
+ Operator - "AND" or "OR"
+ Operands – An array of `MetricGroup`, can support up to two groups. 
+ FilterClause – Rule level metric filter for **End Dimension** or grouping. Choosing an End Dimension restricts the usage of metrics, as described in [Metric Data Update - MetricCondition](https://docs.aws.amazon.com/connect/latest/APIReference/OnMetricDataUpdate.html#OnMetricDataUpdate-MetricCondition). 

```
"Operator": "AND", // "AND or "OR"
"Operand": MetricGroup[], // Upto 2 array elements
"FilterClause" {
    "LogicOperator": "AND", // Only "AND" is supported
    "Filters": [
        {
            "Type": "MetricDataGrouping",
            "Data": ["AGENT" | "QUEUE" | "ROUTING_PROFILE" | "FLOW"] // // Only one is supported
        },
    ]
}
```

## Metric Data Update - MetricGroup


Each MetricGroup can have up to compatible 10 MetricConditions grouped by an "AND" or "OR". Up to two MetricGroups are supported within the same Rule Condition.

```
"Operands": [
    {
        "Operator": "AND", // "AND or "OR"
        "Operands": MetricCondition[], // Upto 10 array elements
    },
    ...
]
```

## Metric Data Update - Metric Filters


Every MetricCondition has a compound filter format, and requires a list of mandatory filters and some optional filters.

### Required filters


These filters are always required in MetricCondition for the when supported, but not supported in others.

#### MetricDataPeriodSeconds


The trailing time period window, in seconds, for which the metric is calculated. All MetricCondition within the same MetricGroup are required to have a consistent MetricDataPeriodSeconds, that is, the exact same filter in all of them, or none of them should have these filters. The time window has to less than 24 hours (< 86400).

```
{
    "Type": "MetricDataPeriodSeconds", // Required for Historical mertcis
    "Data": { "Past": 300} 
}
```

Supported metrics: `AVG_HANDLE_TIME`, `AVG_QUEUE_ANSWER_TIME`, `AVG_INTERACTION_TIME`, `AVG_HOLD_TIME`, `SERVICE_LEVEL_X`, `AGENT_OCCUPANCY`. These metrics cannot be clubbed with other metrics in the same MetricGroup.

#### AgentActivityDurationSeconds


This filter is only required for `AGENT_ACTIVITY` metric, and determines the time period window, in seconds, for which the Agent Activity status is held. It has to less than 24 hours (< 86400).

```
{
    "Type": "AgentActvityDurationSeconds",
    "Data": { "Past": 300} 
}
```

#### MetricDataThresholdSeconds


This filter is only required for `SERVICE_LEVEL_X`, and is defined [here](https://docs.aws.amazon.com/connect/latest/APIReference/API_MetricV2.html#connect-Type-MetricV2-Threshold). 

```
{
    "Type": "MetricDataThresholdSeconds",
    "Data": { "Comparison": "LT", "ThresholdValue": 300} // Comparison == "LT" only
}
```

### End Dimension filters


Exactly one of the below filters is required for every MetricCondition. If the MetricConditions are in the same group, then they are required to have the same End Dimension Filter. For more information about these filters, see [GetMetricDataV2 request filters](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetMetricDataV2.html#connect-GetMetricDataV2-request-Filters). 

#### MetricDataFilterByAgent


Provide the list of Agent IDs in MetricCondition. Up to 25 values can be provided.

```
{
    "Type": "MetricDataFilterByAgent",
    "Data": ["c04377e2-db01-4182-bc02-4285a66279e7", "1e5a6965-7b64-420d-88a8-a83d2a15081d"]
}
```

#### MetricDataFilterByAgentHierarchyLevelX


Agent Hierarchy filters can be any of the five types: 

1. MetricDataFilterByAgentHierarchyLevelOne

1. MetricDataFilterByAgentHierarchyLevelTwo 

1. MetricDataFilterByAgentHierarchyLevelThree

1. MetricDataFilterByAgentHierarchyLevelFour

1. MetricDataFilterByAgentHierarchyLevelFive

Provide the Agent Hierarchy ID in the filter. 

```
{
    "Type": "MetricDataFilterByAgentHierarchyLevelFive", 
    "Data": ["b99ba702-b84b-4279-abad-5ceda9ff2640"] // One array element only
}
```

**Note**  
Only one value is supported in the filter.

#### MetricDataFilterByQueue


Provide the list of Queue IDs in MetricCondition. Up to 25 values can be provided.

```
{
    "Type": "MetricDataFilterByQueue",
    "Data": ["c04377e2-db01-4182-bc02-4285a66279e7", "1e5a6965-7b64-420d-88a8-a83d2a15081d"]
}
```

#### MetricDataFilterByRoutingProfile


Provide the list of Routing Profile IDs in MetricCondition. Up to 25 values can be provided.

```
{
    "Type": "MetricDataFilterByRoutingProfile",
    "Data": ["b653beae-0a34-4f0c-83d3-067c9b8370bf" , "60a4c89a-b485-4bf2-8396-2a151b4e05a7"]
}
```

#### MetricDataFilterByFlow


Provide the list of Flow IDs in MetricCondition. Up to 25 values can be provided.

```
{
    "Type": "MetricDataFilterByFlow",
    "Data": ["a04377e2-zb01-g182-nc02-a285a66279en", "ae5a6965-zb64-g20d-n8a8-a83d2a15081n"]
}
```

#### MetricDataFilterByFlowModule


Provide the list of flow module IDs in MetricCondition. Up to 25 values can be provided.

```
{
    "Type": "MetricDataFilterByFlowModule",
    "Data": ["a04377e2-zb01-g182-nc02-a285a66279en", "ae5a6965-zb64-g20d-n8a8-a83d2a15081n"]
}
```

#### MetricDataFilterByFlowOutcomeType


Flow Outcome Type filter values can be any of the following depending on the filter resource is flow/module.
+ DROPPED
+ DISCONNECTED\$1PARTICIPANT
+ ENDED\$1FLOW\$1EXECUTION
+ TRANSFERRED\$1TO\$1QUEUE
+ TRANSFERRED\$1TO\$1AGENT
+ TRANSFERRED\$1TO\$1FLOW
+ TRANSFERRED\$1TO\$1PHONE\$1NUMBER
+ RETURNED\$1TO\$1FLOW

```
{
    "Type": "MetricDataFilterByFlowOutcomeType", 
    "Data": ["DROPPED", "TRANSFERRED_TO_QUEUE"] // Multiple values can be provided
}
```

### Optional filters


The following filters are optional in MetricCondition.

#### MetricDataFilterByChannel


This is an optional filter that is supported in MetricCondition for all metrics. However, if used, it is require to be consistent for every MetricCondition. 

```
{
    "Type": "MetricDataFilterByChannel",
    "Data": ["VOICE", "CHAT", "TASK"], // any subset of this is valid
}
```

Exception: It cannot be used with `AGENT_ACTIVITY` and `AGENT_OCCUPANCY` metrics, but can be used for other metrics in the same RuleCondition but within a different MetricGroup.

## Metric Data Update - MetricCondition


**Topics**
+ [

### AGENT\$1ACTIVITY
](#MetricCondition-Agent-Activity)
+ [

### OLDEST\$1CONTACT\$1AGE
](#MetricCondition-Oldest-contact-age)
+ [

### AGENTS\$1AVAILABLE
](#MetricCondition-AGENTS_AVAILABLE)
+ [

### CONTACTS\$1IN\$1QUEUE
](#MetricCondition-CONTACTS_IN_QUEUE)
+ [

### AVG\$1QUEUE\$1ANSWER\$1TIME
](#MetricCondition-AVG_QUEUE_ANSWER_TIME)
+ [

### AVG\$1INTERACTION\$1TIME
](#MetricCondition-AVG_INTERACTION_TIME)
+ [

### AVG\$1HOLD\$1TIME
](#MetricCondition-AVG_HOLD_TIME)
+ [

### AVG\$1HANDLE\$1TIME
](#MetricCondition-AVG_HANDLE_TIME)
+ [

### AGENT\$1OCCUPANCY
](#MetricCondition-AGENT_OCCUPANCY)
+ [

### SERVICE\$1LEVEL
](#MetricCondition-SERVICE_LEVEL)
+ [

### FLOWS\$1STARTED
](#FLOWSSTARTED)
+ [

### AVG\$1FLOW\$1TIME
](#AVG_FLOW_TIME)
+ [

### MAX\$1FLOW\$1TIME
](#MAX_FLOW_TIME)
+ [

### MIN\$1FLOW\$1TIME
](#MIN_FLOW_TIME)
+ [

### FLOWS\$1OUTCOME
](#FLOWS_OUTCOME)
+ [

### PERCENT\$1FLOWS\$1OUTCOME
](#PERCENT_FLOWS_OUTCOME)

### AGENT\$1ACTIVITY


For more information about the AGENT\$1ACTIVITY metric, see [AGENT\$1ACTIVITY](https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#agent-activity-state-real-time) and [About agent status](https://docs.aws.amazon.com/connect/latest/adminguide/metrics-agent-status.html). 

The `AGENT_ACTIVITY` metric supports an agent s`tatusId`, or string values of one of the following states: `ERROR`, `MISSED`, `REJECTED`, `ON_CONTACT`, `AFTER_CONTACT_WORK`, `INCOMING`, `AVAILABLE`.

The following example shows:

```
Rule: When any agent with Hierarchy Level 1 (filterValue = b99ba702-b84b-4279-abad-5ceda9ff2640) has 
                        had AGENT_ACTIVITY equal to statusId ee8c71b9-49c2-4d00-ab6d-244f2d9a5c58 for the last 600 seconds, then perform a [RuleAction](https://docs.aws.amazon.com/connect/latest/APIReference/API_RuleAction.html).
```

```
{
    Operator: "EQUALS", // Fixed value
    ComparisonValue: "$.MetricData.AGENT_ACTIVITY",
    Operands: ["ee8c71b9-49c2-4d00-ab6d-244f2d9a5c58"],
    FilterClause: {
      LogicOperator: "AND", // Always "AND"
      Filters: [
        {
          Type: "MetricDataFilterByAgentHierarchyLevelOne",
          Data: ["b99ba702-b84b-4279-abad-5ceda9ff2640"],
        },
        {
          Type: "AgentActivityDurationSeconds",
          Data: { Past: 600 },
        },
      ],
    },
    Negate: true, // or false
  },
```

Supported End Dimensions (MetricDataGrouping): `AGENT`

Required Filters: `AgentActivityDurationSeconds`

Supported End Dimension Filters: `MetricDataFilterByAgent`, `MetricDataFilterByAgentHierarchyLevelX`, `MetricDataFilterByQueue`, `MetricDataFilterByRoutingProfile`

### OLDEST\$1CONTACT\$1AGE


For more information about the OLDEST\$1CONTACT\$1AGE metric, see [GetCurrentMetricData](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetCurrentMetricData.html) and [Oldest](https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#oldest-real-time). 

Rule: OLDEST\$1CONTACT\$1AGE metric value, filtered by listed queues and channels ≥ 900 (15 minutes), then perform a [RuleAction](https://docs.aws.amazon.com/connect/latest/APIReference/API_RuleAction.html). 

```
{
    Operator: "NumberGreaterOrEqualTo", // also supports "NumberLessOrEqualTo"
    ComparisonValue: "$.MetricData.OLDEST_CONTACT_AGE",
    Operands: [900],
    FilterClause: {
      LogicOperator: "AND", // Always "AND"
      Filters: [
        {
          Type: "MetricDataFilterByQueue",
          Data: ["c04377e2-db01-4182-bc02-4285a66279e7", "1e5a6965-7b64-420d-88a8-a83d2a15081d"],
        },
        {
          Type: "MetricDataFilterByChannel",
          Data: ["CHAT"],
        },
      ],
    },
    Negate: false, // Fixed value
}
```

Supported End Dimensions (MetricDataGrouping): `QUEUE`

Required filters: `MetricDataFilterByQueue`, `MetricDataFilterByRoutingProfile`

Supported optional filters: `MetricDataFilterByChannel`

### AGENTS\$1AVAILABLE


For more information about the AGENTS\$1AVAILABLE metric, see [GetCurrentMetricData](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetCurrentMetricData.html) and [Available](https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#available-real-time). 

Rule: `AGENTS_AVAILABLE` metric value, filtered by listed queues and channels ≤ 5, then perform a [RuleAction](https://docs.aws.amazon.com/connect/latest/APIReference/API_RuleAction.html).

```
{
    Operator: "NumberLessOrEqualTo", // also supports "NumberGreaterOrEqualTo"
    ComparisonValue: "$.MetricData.AGENTS_AVAILABLE",
    Operands: [5],
    FilterClause: {
      LogicOperator: "AND", // Always "AND"
      Filters: [
        {
          Type: "MetricDataFilterByQueue",
          Data: ["c04377e2-db01-4182-bc02-4285a66279e7", "1e5a6965-7b64-420d-88a8-a83d2a15081d"],
        },
        {
          Type: "MetricDataFilterByChannel",
          Data: ["CHAT"],
        },
      ],
    },
    Negate: false, // fixed value
  },
```

Supported End Dimensions (MetricDataGrouping): `QUEUE`, `ROUTING_PROFILE`

Supported End Dimension filters: `MetricDataFilterByQueue`, `MetricDataFilterByRoutingProfile`

Supported optional filters: `MetricDataFilterByChannel`

### CONTACTS\$1IN\$1QUEUE


For more information about the `CONTACTS_IN_QUEUE` metric, see [GetCurrentMetricData](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetCurrentMetricData.html) and [In queue](https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#in-queue-real-time). 

Rule: CONTACTS\$1IN\$1QUEUE metric value, filtered by listed queues and channels ≥ 100, then perform a [RuleAction](https://docs.aws.amazon.com/connect/latest/APIReference/API_RuleAction.html).

```
{
    Operator: "NumberGreaterOrEqualTo", // also supports "NumberLessOrEqualTo"
    ComparisonValue: "$.MetricData.CONTACTS_IN_QUEUE",
    Operands: [100],
    FilterClause: {
      LogicOperator: "AND", // Always "AND"
      Filters: [
        {
          Type: "MetricDataFilterByQueue",
          Data: ["c04377e2-db01-4182-bc02-4285a66279e7", "1e5a6965-7b64-420d-88a8-a83d2a15081d"],
        },
        {
          Type: "MetricDataFilterByChannel",
          Data: ["CHAT"],
        },
      ],
    },
    Negate: false, // fixed value
},
```

Supported End Dimensions (MetricDataGrouping): `QUEUE` 

Supported End Dimension filters: `MetricDataFilterByQueue`, `MetricDataFilterByRoutingProfile`

Supported optional filters: `MetricDataFilterByChannel`

### AVG\$1QUEUE\$1ANSWER\$1TIME


For more information about the AVG\$1QUEUE\$1ANSWER\$1TIME metric, see [GetCurrentMetricData](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetMetricDataV2.html) and [Avg queue answer time](https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#average-queue-answer-time-real-time). 

Rule: AVG\$1QUEUE\$1ANSWER\$1TIME metric value, over the given duration of 28800 seconds (8 hours), filtered by listed queues and channels ≥ 900 (15 minutes), then perform a [RuleAction](https://docs.aws.amazon.com/connect/latest/APIReference/API_RuleAction.html).

```
{
    Operator: "NumberGreaterOrEqualTo", // also supports "NumberLessOrEqualTo"
    ComparisonValue: "$.MetricData.AVG_QUEUE_ANSWER_TIME",
    Operands: [900],
    FilterClause: {
      LogicOperator: "AND", // Always "AND"
      Filters: [
        {
          Type: "MetricDataFilterByQueue",
          Data: ["c04377e2-db01-4182-bc02-4285a66279e7", "1e5a6965-7b64-420d-88a8-a83d2a15081d"],
        },
        {
          Type: "MetricDataFilterByChannel",
          Data: ["CHAT"],
        },
        {
          Type: "MetricDataDurationSeconds",
          Data: { Past: 28800 },
        },
      ],
    },
    Negate: false, // fixed value
  }
```

Supported End Dimensions (MetricDataGrouping): `QUEUE` 

Required Filters: `MetricDataDurationSeconds`

Supported End Dimension filters: `MetricDataFilterByQueue`, `MetricDataFilterByRoutingProfile`

Supported optional filters: `MetricDataFilterByChannel`

### AVG\$1INTERACTION\$1TIME


For more information about the AVG\$1INTERACTION\$1TIME metric, see [GetMetricDataV2](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetMetricDataV2.html). 

Rule: AVG\$1INTERACTION\$1TIME metric value, over the given duration of 28800 seconds (8 hours), filtered by listed queues and channels ≥ 1800 (30 minutes), then perform a [RuleAction](https://docs.aws.amazon.com/connect/latest/APIReference/API_RuleAction.html).

```
{
    Operator: "NumberGreaterOrEqualTo", // also supports "NumberLessOrEqualTo"
    ComparisonValue: "$.MetricData.AVG_INTERACTION_TIME",
    Operands: [1800],
    FilterClause: {
      LogicOperator: "AND", // Always "AND"
      Filters: [
        {
          Type: "MetricDataFilterByQueue",
          Data: ["c04377e2-db01-4182-bc02-4285a66279e7", "1e5a6965-7b64-420d-88a8-a83d2a15081d"],
        },
        {
          Type: "MetricDataFilterByChannel",
          Data: ["CHAT"],
        },
        {
          Type: "MetricDataDurationSeconds",
          Data: { Past: 28800 }, // 8 hours
        },
      ],
    },
    Negate: false, // fixed value
  },
```

Supported End Dimensions (MetricDataGrouping): `QUEUE` 

Required Filters: `MetricDataDurationSeconds`

Supported End Dimension filters: `MetricDataFilterByQueue`, `MetricDataFilterByRoutingProfile`

Supported optional filters: `MetricDataFilterByChannel`

### AVG\$1HOLD\$1TIME


For more information about the AVG\$1HOLD\$1TIME metric, see [GetMetricDataV2](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetMetricDataV2.html). 

Rule: AVG\$1HOLD\$1TIME metric value, over the given duration of 28800 seconds (8 hours), filtered by listed queues and channels ≥ 1800 (30 minutes), then perform a [RuleAction](https://docs.aws.amazon.com/connect/latest/APIReference/API_RuleAction.html).

```
{
    Operator: "NumberGreaterOrEqualTo", // also supports "NumberLessOrEqualTo"
    ComparisonValue: "$.MetricData.AVG_HOLD_TIME",
    Operands: [1800],
    FilterClause: {
      LogicOperator: "AND", // Always "AND"
      Filters: [
        {
          Type: "MetricDataFilterByQueue",
          Data: ["c04377e2-db01-4182-bc02-4285a66279e7", "1e5a6965-7b64-420d-88a8-a83d2a15081d"],
        },
        {
          Type:"MetricDataFilterByChannel",
          Data: ["CHAT"],
        },
        {
          Type: "MetricDataDurationSeconds",
          Data: { Past: 28800 },
        },
      ],
    },
    Negate: false, // fixed value
  },
```

Supported End Dimensions (MetricDataGrouping): `QUEUE` 

Required Filters: `MetricDataDurationSeconds`

Supported End Dimension filters: `MetricDataFilterByQueue`, `MetricDataFilterByRoutingProfile`

Supported optional filters: `MetricDataFilterByChannel`

### AVG\$1HANDLE\$1TIME


For more information about the AVG\$1HANDLE\$1TIME metric, see [GetMetricDataV2](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetMetricDataV2.html). 

Rule: AVG\$1HANDLE\$1TIME metric value, over the given duration of 28800 seconds (8 hours), filtered by listed queues and channels ≥ 1800 (30 minutes), then perform a [RuleAction](https://docs.aws.amazon.com/connect/latest/APIReference/API_RuleAction.html).

```
{
    Operator: "NumberGreaterOrEqualTo", // also supports "NumberLessOrEqualTo"
    ComparisonValue: "$.MetricData.AVG_HANDLE_TIME",
    Operands: [1800],
    FilterClause: {
      LogicOperator: "AND", // Always "AND"
      Filters: [
        {
          Type: "MetricDataFilterByQueue",
          Data: ["c04377e2-db01-4182-bc02-4285a66279e7", "1e5a6965-7b64-420d-88a8-a83d2a15081d"],
        },
        {
          Type: "MetricDataFilterByChannel",
          Data: ["CHAT"],
        },
        {
          Type: "MetricDataDurationSeconds",
          Data: { Past: 28800 },
        },
      ],
    },
    Negate: false, // fixed value
  },
```

Supported End Dimensions (MetricDataGrouping): `QUEUE`, `AGENT` 

Required Filters: `MetricDataDurationSeconds`

Supported End Dimension filters: For QUEUE end dimension, `MetricDataFilterByQueue` and `MetricDataFilterByRoutingProfile` are supported. For AGENT end dimensions, `MetricDataFilterByQueue`, `MetricDataFilterByRoutingProfile`, `MetricDataFilterByAgent`, and `MetricDataFilterByAgentLevelX` are supported

Supported optional filters: `MetricDataFilterByChannel`

### AGENT\$1OCCUPANCY


For more information about the AGENT\$1OCCUPANCY metric, see [GetMetricDataV2](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetMetricDataV2.html). 

Rule: AGENT\$1OCCUPANCY metric value, over the given duration of 28800 seconds (8 hours), filtered by listed queues and channels ≥ 80%, then perform a [RuleAction](https://docs.aws.amazon.com/connect/latest/APIReference/API_RuleAction.html).

```
{
    Operator: "NumberGreaterOrEqualTo", // also supports "NumberLessOrEqualTo"
    ComparisonValue: "$.MetricData.AGENT_OCCUPANCY",
    Operands: [80],
    FilterClause: {
      LogicOperator: "AND", // Always "AND"
      Filters: [
        {
          Type: "MetricDataFilterByAgent",
          Data: ["c04377e2-db01-4182-bc02-4285a66279e7", "1e5a6965-7b64-420d-88a8-a83d2a15081d"],
        },
        {
          Type: "MetricDataDurationSeconds",
          Data: { Past: 300 },
        },
      ],
    },
    Negate: false, // fixed value
  },
```

Supported End Dimensions (MetricDataGrouping): `AGENT` 

Required Filters: `MetricDataDurationSeconds`

Supported End Dimension filters: `MetricDataFilterByAgent`, `MetricDataFilterByAgentLevelX`, `MetricDataFilterByRoutingProfile`

### SERVICE\$1LEVEL


For more information about the SERVICE\$1LEVEL metric, see [GetMetricDataV2](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetMetricDataV2.html). 

Rule: SERVICE\$1LEVEL metric value, over the given duration of 600 (10 minutes) metric value, over the given duration of 28800 seconds (8 hours), filtered by listed queues and channels ≤ 50%, then perform a [RuleAction](https://docs.aws.amazon.com/connect/latest/APIReference/API_RuleAction.html).

```
{
    Operator: "NumberLessOrEqualTo", // also supports "NumberGreaterOrEqualTo"
    ComparisonValue: "$.MetricData.SERVICE_LEVEL",
    Operands: [50],
    FilterClause: {
      LogicOperator: "AND", // Always "AND"
      Filters: [
        {
          Type: "MetricDataFilterByQueue",
          Data: ["c04377e2-db01-4182-bc02-4285a66279e7", "1e5a6965-7b64-420d-88a8-a83d2a15081d"],
        },
        {
          Type: "MetricDataFilterByChannel",
          Data: ["CHAT"],
        },
        {
          Type: "MetricDataDurationSeconds",
          Data: { Past: 28800 },
        },
        {
          Type: "MetricDataThresholdSeconds",
          Data: { Comparison: MetricThresholdComparison.LT, ThresholdValue: 600},
        },
      ],
    },
    Negate: false, // fixed value
  },
```

Supported End Dimensions (MetricDataGrouping): `QUEUE` 

Required filters: `MetricDataDurationSeconds`, `MetricDataThresholdSeconds`

Supported End Dimension filters: `MetricDataFilterByQueue`, `MetricDataFilterByRoutingProfile`

Supported optional filters: `MetricDataFilterByChannel`

### FLOWS\$1STARTED


For more information about the FLOWS\$1STARTED metric, see [GetMetricDataV2](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetMetricDataV2.html).

Rule : FLOWS\$1STARTED metric value, over the given duration of 300 seconds (5 minutes), filtered by listed flows and channels 10, then perform a [RuleAction](https://docs.aws.amazon.com/connect/latest/APIReference/API_RuleAction.html). 

```
{
    Operator: "NumberGreaterOrEqualTo", // also supports "NumberLessOrEqualTo"
    ComparisonValue: "$.MetricData.FLOWS_STARTED",
    Operands: [10],
    FilterClause: {
      LogicOperator: "AND", // Always "AND"
      Filters: [
        {
          Type: "MetricDataFilterByFlow",
          Data: ["c04377e2-db01-4182-bc02-4285a66279e7", "1e5a6965-7b64-420d-88a8-a83d2a15081d"],
        },
        {
          Type: "MetricDataDurationSeconds",
          Data: { Past: 300 }
        },
        {
          Type: "MetricDataFilterByChannel",
          Data: ["CHAT"],
        },
      ],
    },
    Negate: false, // Fixed value
}
```

Supported End Dimensions (MetricDataGrouping): `FLOW`

Required Filters: `MetricDataDurationSeconds`

Supported End Dimension filters: `MetricDataFilterByFlow`, `MetricDataFilterByFlowModule`

Supported optional filters: `MetricDataFilterByChannel`

### AVG\$1FLOW\$1TIME


For more information about the AVG\$1FLOW\$1TIME metric, see [GetMetricDataV2](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetMetricDataV2.html).

Rule : `AVG_FLOW_TIME` metric value, over the given duration of 300 seconds (5 minutes), filtered by listed flows, flow outcomes and channels >= 600 (10 minutes), then perform a [RuleAction](https://docs.aws.amazon.com/connect/latest/APIReference/API_RuleAction.html).

```
{
    Operator: "NumberGreaterOrEqualTo", // also supports "NumberLessOrEqualTo"
    ComparisonValue: "$.MetricData.AVG_FLOW_TIME",
    Operands: [600],
    FilterClause: {
      LogicOperator: "AND", // Always "AND"
      Filters: [
        {
          Type: "MetricDataFilterByFlow",
          Data: ["5f873afb-f359-4c54-b626-ecad1bd3f774"],
        },
        {
          Type: "MetricDataFilterByFlowOutcomeType",
          Data: ["DROPPED", "TRANSFERRED_TO_QUEUE"],
        },
        {
          Type: "MetricDataDurationSeconds",
          Data: {
            "Past": 300
          },
        },
        {
          Type: "MetricDataFilterByChannel",
          Data: ["CHAT"],
        },
      ],
    },
    Negate: false, // Fixed value
}
```

Supported End Dimensions (MetricDataGrouping): `FLOW`

Required Filters: `MetricDataDurationSeconds`

Supported End Dimension filters: `MetricDataFilterByFlow`, `MetricDataFilterByFlowModule`, `MetricDataFilterByFlowOutcomeType`

Supported optional filters: `MetricDataFilterByChannel`

### MAX\$1FLOW\$1TIME


For more information about the MAX\$1FLOW\$1TIME metric, see [GetMetricDataV2](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetMetricDataV2.html).

Rule : `MAX_FLOW_TIME` metric value, over the given duration of 300 seconds (5 minutes), filtered by listed flows, flow outcomes and channels >= 600 (10 minutes), then perform a [RuleAction](https://docs.aws.amazon.com/connect/latest/APIReference/API_RuleAction.html).

```
{
    Operator: "NumberGreaterOrEqualTo", // also supports "NumberLessOrEqualTo"
    ComparisonValue: "$.MetricData.MAX_FLOW_TIME",
    Operands: [600],
    FilterClause: {
      LogicOperator: "AND", // Always "AND"
      Filters: [
        {
          Type: "MetricDataFilterByFlow",
          Data: ["5f873afb-f359-4c54-b626-ecad1bd3f774"],
        },
        {
          Type: "MetricDataFilterByFlowOutcomeType",
          Data: ["DROPPED", "TRANSFERRED_TO_QUEUE"],
        },
        {
          Type: "MetricDataDurationSeconds",
          Data: {
            "Past": 300
          },
        },
        {
          Type: "MetricDataFilterByChannel",
          Data: ["CHAT"],
        },
      ],
    },
    Negate: false, // Fixed value
}
```

Supported End Dimensions (MetricDataGrouping): `FLOW`

Required Filters: `MetricDataDurationSeconds`

Supported End Dimension filters: `MetricDataFilterByFlow`, `MetricDataFilterByFlowModule`, `MetricDataFilterByFlowOutcomeType`

Supported optional filters: `MetricDataFilterByChannel`

### MIN\$1FLOW\$1TIME


For more information about the MIN\$1FLOW\$1TIME metric, see [GetMetricDataV2](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetMetricDataV2.html).

Rule : `MIN_FLOW_TIME` metric value, over the given duration of 300 seconds (5 minutes), filtered by listed flows, flow outcomes and channels >= 600 (10 minutes), then perform a [RuleAction](https://docs.aws.amazon.com/connect/latest/APIReference/API_RuleAction.html).

```
{
    Operator: "NumberGreaterOrEqualTo", // also supports "NumberLessOrEqualTo"
    ComparisonValue: "$.MetricData.MIN_FLOW_TIME",
    Operands: [600],
    FilterClause: {
      LogicOperator: "AND", // Always "AND"
      Filters: [
        {
          Type: "MetricDataFilterByFlow",
          Data: ["5f873afb-f359-4c54-b626-ecad1bd3f774"],
        },
        {
          Type: "MetricDataFilterByFlowOutcomeType",
          Data: ["DROPPED", "TRANSFERRED_TO_QUEUE"],
        },
        {
          Type: "MetricDataDurationSeconds",
          Data: {
            "Past": 300
          },
        },
        {
          Type: "MetricDataFilterByChannel",
          Data: ["CHAT"],
        },
      ],
    },
    Negate: false, // Fixed value
}
```

Supported End Dimensions (MetricDataGrouping): `FLOW`

Required Filters: `MetricDataDurationSeconds`

Supported End Dimension filters: `MetricDataFilterByFlow`, `MetricDataFilterByFlowModule` `MetricDataFilterByFlowOutcomeType`

Supported optional filters: `MetricDataFilterByChannel`

### FLOWS\$1OUTCOME


For more information about the FLOWS\$1OUTCOME metric, see [GetMetricDataV2](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetMetricDataV2.html).

Rule : `FLOWS_OUTCOME` metric value, over the given duration of 300 seconds (5 minutes), filtered by listed flows, flow outcomes and channels >= 10, then perform a [RuleAction](https://docs.aws.amazon.com/connect/latest/APIReference/API_RuleAction.html).

```
{
    Operator: "NumberGreaterOrEqualTo", // also supports "NumberLessOrEqualTo"
    ComparisonValue: "$.MetricData.FLOWS_OUTCOME",
    Operands: [10],
    FilterClause: {
      LogicOperator: "AND", // Always "AND"
      Filters: [
        {
          Type: "MetricDataFilterByFlow",
          Data: ["5f873afb-f359-4c54-b626-ecad1bd3f774"],
        },
        {
          Type: "MetricDataFilterByFlowOutcomeType",
          Data: ["DROPPED", "TRANSFERRED_TO_QUEUE"],
        },
        {
          Type: "MetricDataDurationSeconds",
          Data: {
            "Past": 300
          },
        },
        {
          Type: "MetricDataFilterByChannel",
          Data: ["CHAT"],
        },
      ],
    },
    Negate: false, // Fixed value
}
```

Supported End Dimensions (MetricDataGrouping): `FLOW`

Required Filters: `MetricDataDurationSeconds`

Supported End Dimension filters: `MetricDataFilterByFlow`, `MetricDataFilterByFlowModule`, `MetricDataFilterByFlowOutcomeType`

Supported optional filters: `MetricDataFilterByChannel`

### PERCENT\$1FLOWS\$1OUTCOME


For more information about the PERCENT\$1FLOWS\$1OUTCOME metric, see [GetMetricDataV2](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetMetricDataV2.html).

Rule : `PERCENT_FLOWS_OUTCOME` metric value, over the given duration of 300 seconds (5 minutes), filtered by listed flows, flow outcomes and channels >= 50%, then perform a [RuleAction](https://docs.aws.amazon.com/connect/latest/APIReference/API_RuleAction.html).

```
{
    Operator: "NumberGreaterOrEqualTo", // also supports "NumberLessOrEqualTo"
    ComparisonValue: "$.MetricData.PERCENT_FLOWS_OUTCOME",
    Operands: [50],
    FilterClause: {
      LogicOperator: "AND", // Always "AND"
      Filters: [
        {
          Type: "MetricDataFilterByFlow",
          Data: ["5f873afb-f359-4c54-b626-ecad1bd3f774"],
        },
        {
          Type: "MetricDataFilterByFlowOutcomeType",
          Data: ["DROPPED", "TRANSFERRED_TO_QUEUE"],
        },
        {
          Type: "MetricDataDurationSeconds",
          Data: {
            "Past": 300
          },
        },
        {
          Type: "MetricDataFilterByChannel",
          Data: ["CHAT"],
        },
      ],
    },
    Negate: false, // Fixed value
}
```

Supported End Dimensions (MetricDataGrouping): `FLOW`

Required Filters: `MetricDataDurationSeconds`

Supported End Dimension filters: `MetricDataFilterByFlow`, `MetricDataFilterByFlowModule`, `MetricDataFilterByFlowOutcomeType`

Supported optional filters: `MetricDataFilterByChannel`

## Full examples


### Example 1


A rule with `AGENTS_AVAILABLE`, `OLDEST_CONTACT_AGE`, `CONTACTS_IN_QUEUE` in MetricGroup 1 and `AVG_QUEUE_ANSWER_TIME`, `AVG_HOLD_TIME`, `AVG_INTERACTION_TIME`, `AVG_HANDLE_TIME`, and `SERVICE_LEVEL` in Metric Group 2, both of which have End Dimension = `QUEUE`.

```
{
    "Operator": "OR",
    "Operands": [{
        "Operator": "AND",
        "Operands": [{
            "Operator": "NumberGreaterOrEqualTo",
            "ComparisonValue": "$.MetricData.AGENTS_AVAILABLE",
            "Operands": [0],
            "FilterClause": {
                "LogicOperator": "AND",
                "Filters": [{
                    "Type": "MetricDataFilterByQueue",
                    "Data": ["e7a11ddd-041d-449a-ab1e-6a493cb83626", "26b9c7f4-ed5c-4cd1-b751-2cbfb4c54ea2"]
                }, {
                    "Type": "MetricDataFilterByChannel",
                    "Data": ["VOICE"]
                }]
            },
            "Negate": false
        }, {
            "Operator": "NumberGreaterOrEqualTo",
            "ComparisonValue": "$.MetricData.CONTACTS_IN_QUEUE",
            "Operands": [0],
            "FilterClause": {
                "LogicOperator": "AND",
                "Filters": [{
                    "Type": "MetricDataFilterByQueue",
                    "Data": ["e7a11ddd-041d-449a-ab1e-6a493cb83626", "26b9c7f4-ed5c-4cd1-b751-2cbfb4c54ea2"]
                }, {
                    "Type": "MetricDataFilterByChannel",
                    "Data": ["VOICE"]
                }]
            },
            "Negate": false
        }, {
            "Operator": "NumberGreaterOrEqualTo",
            "ComparisonValue": "$.MetricData.OLDEST_CONTACT_AGE",
            "Operands": [0],
            "FilterClause": {
                "LogicOperator": "AND",
                "Filters": [{
                    "Type": "MetricDataFilterByQueue",
                    "Data": ["e7a11ddd-041d-449a-ab1e-6a493cb83626", "26b9c7f4-ed5c-4cd1-b751-2cbfb4c54ea2"]
                }, {
                    "Type": "MetricDataFilterByChannel",
                    "Data": ["VOICE"]
                }]
            },
            "Negate": false
        }]
    }, {
        "Operator": "OR",
        "Operands": [{
            "Operator": "NumberGreaterOrEqualTo",
            "ComparisonValue": "$.MetricData.AVG_HANDLE_TIME",
            "Operands": [0],
            "FilterClause": {
                "LogicOperator": "AND",
                "Filters": [{
                    "Type": "MetricDataFilterByQueue",
                    "Data": ["e7a11ddd-041d-449a-ab1e-6a493cb83626", "26b9c7f4-ed5c-4cd1-b751-2cbfb4c54ea2"]
                }, {
                    "Type": "MetricDataDurationSeconds",
                    "Data": {
                        "Past": 300
                    }
                }, {
                    "Type": "MetricDataFilterByChannel",
                    "Data": ["VOICE"]
                }]
            },
            "Negate": false
        }, {
            "Operator": "NumberGreaterOrEqualTo",
            "ComparisonValue": "$.MetricData.AVG_QUEUE_ANSWER_TIME",
            "Operands": [0],
            "FilterClause": {
                "LogicOperator": "AND",
                "Filters": [{
                    "Type": "MetricDataFilterByQueue",
                    "Data": ["e7a11ddd-041d-449a-ab1e-6a493cb83626", "26b9c7f4-ed5c-4cd1-b751-2cbfb4c54ea2"]
                }, {
                    "Type": "MetricDataDurationSeconds",
                    "Data": {
                        "Past": 300
                    }
                }, {
                    "Type": "MetricDataFilterByChannel",
                    "Data": ["VOICE"]
                }]
            },
            "Negate": false
        }, {
            "Operator": "NumberGreaterOrEqualTo",
            "ComparisonValue": "$.MetricData.AVG_INTERACTION_TIME",
            "Operands": [0],
            "FilterClause": {
                "LogicOperator": "AND",
                "Filters": [{
                    "Type": "MetricDataFilterByQueue",
                    "Data": ["e7a11ddd-041d-449a-ab1e-6a493cb83626", "26b9c7f4-ed5c-4cd1-b751-2cbfb4c54ea2"]
                }, {
                    "Type": "MetricDataDurationSeconds",
                    "Data": {
                        "Past": 300
                    }
                }, {
                    "Type": "MetricDataFilterByChannel",
                    "Data": ["VOICE"]
                }]
            },
            "Negate": false
        }, {
            "Operator": "NumberGreaterOrEqualTo",
            "ComparisonValue": "$.MetricData.AVG_HOLD_TIME",
            "Operands": [0],
            "FilterClause": {
                "LogicOperator": "AND",
                "Filters": [{
                    "Type": "MetricDataFilterByQueue",
                    "Data": ["e7a11ddd-041d-449a-ab1e-6a493cb83626", "26b9c7f4-ed5c-4cd1-b751-2cbfb4c54ea2"]
                }, {
                    "Type": "MetricDataDurationSeconds",
                    "Data": {
                        "Past": 300
                    }
                }, {
                    "Type": "MetricDataFilterByChannel",
                    "Data": ["VOICE"]
                }]
            },
            "Negate": false
        }, {
            "Operator": "NumberGreaterOrEqualTo",
            "ComparisonValue": "$.MetricData.SERVICE_LEVEL",
            "Operands": [0],
            "FilterClause": {
                "LogicOperator": "AND",
                "Filters": [{
                    "Type": "MetricDataFilterByQueue",
                    "Data": ["e7a11ddd-041d-449a-ab1e-6a493cb83626", "26b9c7f4-ed5c-4cd1-b751-2cbfb4c54ea2"]
                }, {
                    "Type": "MetricDataDurationSeconds",
                    "Data": {
                        "Past": 300
                    }
                }, {
                    "Type": "MetricDataThresholdSeconds",
                    "Data": {
                        "Comparison": "LT",
                        "ThresholdValue": 60
                    }
                }, {
                    "Type": "MetricDataFilterByChannel",
                    "Data": ["VOICE"]
                }]
            },
            "Negate": false
        }]
    }],
    "FilterClause": {
        "LogicOperator": "AND",
        "Filters": [{
            "Type": "MetricDataGrouping",
            "Data": ["QUEUE"]
        }]
    }
}
```

### Example 2


A rule with `AGENT_OCCUPANCY` in MetricGroup 1 and ` AGENT_ACTIVITY` and MetricGroup 2, with End Dimension = `AGENT`.

```
{
    "Operator": "OR",
    "Operands": [{
        "Operator": "AND",
        "Operands": [{
            "Operator": "NumberGreaterOrEqualTo",
            "ComparisonValue": "$.MetricData.AGENT_OCCUPANCY",
            "Operands": [0],
            "FilterClause": {
                "LogicOperator": "AND",
                "Filters": [{
                    "Type": "MetricDataFilterByAgent",
                    "Data": ["e7a11ddd-041d-449a-ab1e-6a493cb83626", "26b9c7f4-ed5c-4cd1-b751-2cbfb4c54ea2"]
                }, {
                    "Type": "MetricDataDurationSeconds",
                    "Data": {
                        "Past": 100
                    }
                }]
            },
            "Negate": false
        }]
    }, {
        "Operator": "AND",
        "Operands": [{
            "Operator": "EQUALS",
            "ComparisonValue": "$.MetricData.AGENT_ACTIVITY",
            "Operands": ["ee8c71b9-49c2-4d00-ab6d-244f2d9a5c58"],
            "FilterClause": {
                "LogicOperator": "AND",
                "Filters": [{
                    "Type": "MetricDataFilterByAgentHierarchyLevelOne",
                    "Data": ["b99ba702-b84b-4279-abad-5ceda9ff2640"]
                }, {
                    "Type": "MetricDataDurationSeconds",
                    "Data": {
                        "Past":600
                    }
                }]
            },
            "Negate": false
        }]
    }],
    "FilterClause": {
        "LogicOperator": "AND",
        "Filters": [{
            "Type": "MetricDataGrouping",
            "Data": ["AGENT"]
        }]
    }
}
```

### Example 3


A rule with `FLOWS_STARTED`, `AVG_FLOW_TIME`, `MAX_FLOW_TIME` in MetricGroup 1 and `FLOWS_OUTCOME`, `PERCENT_FLOWS_OUTCOME` and `MIN_FLOW_TIME` in Metric Group 2, both of which have End Dimension = `FLOW`.

```
{
  "Operator": "OR",
  "Operands": [
    {
      "Operator": "AND",
      "Operands": [
        {
          "Operator": "NumberGreaterOrEqualTo",
          "ComparisonValue": "$.MetricData.FLOWS_STARTED",
          "Operands": [
            10
          ],
          "FilterClause": {
            "LogicOperator": "AND",
            "Filters": [
              {
                "Type": "MetricDataFilterByFlow",
                "Data": [
                  "z2a11ddd-041d-449a-ab1e-6a493cb83621",
                  "y1b9c7f4-ed5c-4cd1-b751-2cbfb4c54ea3"
                ]
              },
              {
                "Type": "MetricDataFilterByChannel",
                "Data": [
                  "VOICE"
                ]
              },
              {
                "Type": "MetricDataDurationSeconds",
                "Data": {
                  "Past": 300
                }
              }
            ]
          },
          "Negate": false
        },
        {
          "Operator": "NumberGreaterOrEqualTo",
          "ComparisonValue": "$.MetricData.AVG_FLOW_TIME",
          "Operands": [
            600
          ],
          "FilterClause": {
            "LogicOperator": "AND",
            "Filters": [
              {
                "Type": "MetricDataFilterByFlow",
                "Data": [
                  "z2a11ddd-041d-449a-ab1e-6a493cb83621",
                  "y1b9c7f4-ed5c-4cd1-b751-2cbfb4c54ea3"
                ]
              },
              {
                "Type": "MetricDataFilterByFlowOutcomeType",
                "Data": [
                  "DROPPED",
                  "TRANSFERRED_TO_QUEUE"
                ]
              },
              {
                "Type": "MetricDataFilterByChannel",
                "Data": [
                  "VOICE"
                ]
              },
              {
                "Type": "MetricDataDurationSeconds",
                "Data": {
                  "Past": 300
                }
              }
            ]
          },
          "Negate": false
        },
        {
          "Operator": "NumberGreaterOrEqualTo",
          "ComparisonValue": "$.MetricData.MAX_FLOW_TIME",
          "Operands": [
            600
          ],
          "FilterClause": {
            "LogicOperator": "AND",
            "Filters": [
              {
                "Type": "MetricDataFilterByFlow",
                "Data": [
                  "z2a11ddd-041d-449a-ab1e-6a493cb83621",
                  "y1b9c7f4-ed5c-4cd1-b751-2cbfb4c54ea3"
                ]
              },
              {
                "Type": "MetricDataFilterByFlowOutcomeType",
                "Data": [
                  "DROPPED",
                  "TRANSFERRED_TO_QUEUE"
                ]
              },
              {
                "Type": "MetricDataFilterByChannel",
                "Data": [
                  "VOICE"
                ]
              },
              {
                "Type": "MetricDataDurationSeconds",
                "Data": {
                  "Past": 300
                }
              }
            ]
          },
          "Negate": false
        }
      ]
    },
    {
      "Operator": "OR",
      "Operands": [
        {
          "Operator": "NumberGreaterOrEqualTo",
          "ComparisonValue": "$.MetricData.FLOWS_OUTCOME",
          "Operands": [
            10
          ],
          "FilterClause": {
            "LogicOperator": "AND",
            "Filters": [
              {
                "Type": "MetricDataFilterByFlow",
                "Data": [
                  "z2a11ddd-041d-449a-ab1e-6a493cb83621",
                  "y1b9c7f4-ed5c-4cd1-b751-2cbfb4c54ea3"
                ]
              },
              {
                "Type": "MetricDataFilterByFlowOutcomeType",
                "Data": [
                  "DROPPED",
                  "TRANSFERRED_TO_QUEUE"
                ]
              },
              {
                "Type": "MetricDataFilterByChannel",
                "Data": [
                  "VOICE"
                ]
              },
              {
                "Type": "MetricDataDurationSeconds",
                "Data": {
                  "Past": 300
                }
              }
            ]
          },
          "Negate": false
        },
        {
          "Operator": "NumberGreaterOrEqualTo",
          "ComparisonValue": "$.MetricData.PERCENT_FLOWS_OUTCOME",
          "Operands": [
            50
          ],
          "FilterClause": {
            "LogicOperator": "AND",
            "Filters": [
              {
                "Type": "MetricDataFilterByFlow",
                "Data": [
                  "z2a11ddd-041d-449a-ab1e-6a493cb83621",
                  "y1b9c7f4-ed5c-4cd1-b751-2cbfb4c54ea3"
                ]
              },
              {
                "Type": "MetricDataFilterByFlowOutcomeType",
                "Data": [
                  "DROPPED",
                  "TRANSFERRED_TO_QUEUE"
                ]
              },
              {
                "Type": "MetricDataFilterByChannel",
                "Data": [
                  "VOICE"
                ]
              },
              {
                "Type": "MetricDataDurationSeconds",
                "Data": {
                  "Past": 300
                }
              }
            ]
          },
          "Negate": false
        },
        {
          "Operator": "NumberGreaterOrEqualTo",
          "ComparisonValue": "$.MetricData.MIN_FLOW_TIME",
          "Operands": [
            600
          ],
          "FilterClause": {
            "LogicOperator": "AND",
            "Filters": [
              {
                "Type": "MetricDataFilterByFlow",
                "Data": [
                  "z2a11ddd-041d-449a-ab1e-6a493cb83621",
                  "y1b9c7f4-ed5c-4cd1-b751-2cbfb4c54ea3"
                ]
              },
              {
                "Type": "MetricDataFilterByFlowOutcomeType",
                "Data": [
                  "DROPPED",
                  "TRANSFERRED_TO_QUEUE"
                ]
              },
              {
                "Type": "MetricDataFilterByChannel",
                "Data": [
                  "VOICE"
                ]
              },
              {
                "Type": "MetricDataDurationSeconds",
                "Data": {
                  "Past": 300
                }
              }
            ]
          },
          "Negate": false
        }
      ]
    }
  ],
  "FilterClause": {
    "LogicOperator": "AND",
    "Filters": [
      {
        "Type": "MetricDataGrouping",
        "Data": [
          "FLOW"
        ]
      }
    ]
  }
}
```

# OnContactEvaluationSubmit


## Agent Hierarchy


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands - Agent hierarchy ARNs.
+ ComparisonValue - "\$1.ContactLens.ContactEvaluation.Agent.HierarchyGroup.ARN"
+ Negate - False

## Initiation Method


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands - A validated enum set of possible values. Possible values are as follows:
  + 'INBOUND'
  + 'OUTBOUND'
  + 'TRANSFER'
  + 'QUEUE\$1TRANSFER'
  + 'CALLBACK'
  + 'API'
  + 'DISCONNECT'
+ ComparisonValue - '\$1.ContactLens.ContactEvaluation.InitiationMethod'
+ Negate - False

## DisconnectReason


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands - A validated enum set of possible values. Possible values are as follows:
  + 'TELECOM\$1BUSY'
  + 'TELECOM\$1NUMBER\$1INVALID'
  + 'TELECOM\$1POTENTIAL\$1BLOCKING'
  + 'TELECOM\$1UNANSWERED'
  + 'TELECOM\$1TIMEOUT'
  + 'TELECOM\$1ORIGINATOR\$1CANCEL'
  + 'TELECOM\$1PROBLEM'
  + 'CUSTOMER\$1NEVER\$1ARRIVED'
  + 'THIRD\$1PARTY\$1DISCONNECT'
  + 'CUSTOMER\$1DISCONNECT'
  + 'AGENT\$1DISCONNECT'
  + 'BARGED'
  + 'CONTACT\$1FLOW\$1DISCONNECT'
  + 'OTHER'
  + 'OUTBOUND\$1DESTINATION\$1ENDPOINT\$1ERROR'
  + 'OUTBOUND\$1RESOURCE\$1ERROR'
  + 'OUTBOUND\$1ATTEMPT\$1FAILED'
  + 'EXPIRED'
  + 'AGENT\$1NETWORK\$1DISCONNECT'
  + 'CUSTOMER\$1CONNECTION\$1NOT\$1ESTABLISHED'
  + 'API'
  + 'IDLE\$1DISCONNECT'
  + 'SYSTEM\$1ERROR'
  + 'AGENT\$1COMPLETED'
  + 'TRANSFERRED'
  + 'DISCARDED'
+ ComparisonValue - "\$1.ContactLens.ContactEvaluation.DisconnectReason"
+ Negate - False

## Routing Profile


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands - Routing profile ARNs.
+ ComparisonValue - "\$1.ContactLens.ContactEvaluation.Agent.RoutingProfile"
+ Negate - False

## PotentialDisconnectIssue


**Parameters**
+ Operator - "CONTAINS\$1ANY" or "EQUALS"
+ Operands - A validated enum of possible values.
+ ComparisonValue - '\$1.ContactLens.ContactEvaluation.PotentialDisconnectIssue'
+ Negate - False

## Custom User-Defined Segment Attribute


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands - A list of segment attribute values. The values must be a value in the pre-defined attribute resource.
+ ComparisonValue - "\$1.ContactLens.ContactEvaluation.SegmentAttributes.UserDefined.[KEY]"

  The KEY must be an instance pre-defined attribute resource.
+ Negate - False or true

## ContactEvaluation - Results available condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is the evaluation form ID. 
+ ComparisonValue – "\$1.ContactLens.ContactEvaluation.Form.FormId"
+ Negate – false

## ContactEvaluation - Form score condition


ContactEvaluation form score condition has a compound condition format where Operator is an AND condition and its operands consist of two conditions that represent the form and the form score. 

**Parameters that represent the form**: See [ContactEvaluation - Results available condition](https://docs.aws.amazon.com/connect/latest/APIReference/OnContactEvaluationSubmit.html#ContactEvaluation-results)

**Parameters that represent the form score:**
+ Operator - "NumberLessOrEqualTo" \$1 "NumberGreaterOrEqualTo"
+ Operands – An array of number, array length can only be 1. Value is the form score. 
+ ComparisonValue – "\$1.ContactLens.ContactEvaluation.Form.Score"
+ Negate – false

Following is an example.

```
{
    "Operator": "AND",
    "Operands": [
        {
            "Operator": "EQUALS",
            "Operands": ["11111111-1234-5678-9123-12345678012"],
            "ComparisonValue": "$.ContactLens.ContactEvaluation.Form.FormId",
            "Negate": false
        },
        {
            "Operator": "NumberLessOrEqualTo",
            "Operands": [50],
            "ComparisonValue": "$.ContactLens.ContactEvaluation.Form.Score",
            "Negate":false
        },
    ]
}
```

## ContactEvaluation - Section Score


ContactEvaluation section score condition has a compound condition format where Operator is an AND condition and its operands consist of three conditions that represent the form, section, and section score respectively.

**Parameters that represent the form**: See [ContactEvaluation - Results available condition](https://docs.aws.amazon.com/connect/latest/APIReference/OnContactEvaluationSubmit.html#ContactEvaluation-results)

**Parameters that represent the section:**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is the section reference ID. 
+ ComparisonValue – "\$1.ContactLens.ContactEvaluation.Section.SectionRefId"
+ Negate – false

**Parameters that represent the section score:**
+ Operator - "NumberLessOrEqualTo" \$1 "NumberGreaterOrEqualTo"
+ Operands – An array of number, array length can only be 1. Value is the section score. 
+ ComparisonValue – "\$1.ContactLens.ContactEvaluation.Section.Score"
+ Negate – false

Following is an example.

```
{
    "Operator": "AND",
    "Operands": [
        {
            "Operator": "EQUALS",
            "Operands": ["11111111-1234-5678-9123-12345678012"],
            "ComparisonValue": "$.ContactLens.ContactEvaluation.Form.FormId",
            "Negate": false
        },
        {
            "Operator": "EQUALS",
            "Operands": ["s12345678"],
            "ComparisonValue": "$.ContactLens.ContactEvaluation.Section.SectionRefId",
            "Negate":false
        },
        {
            "Operator": "NumberLessOrEqualTo",
            "Operands": [50],
            "ComparisonValue": "$.ContactLens.ContactEvaluation.Section.Score",
            "Negate":false
        },
    ]
}
```

## ContactEvaluation - Question and Answer


ContactEvaluation question and answer condition has a compound condition format where Operator is an AND condition and its operands consist of three conditions that represent the form, question, and answer value respectively.

**Parameters that represent the form**: See [ContactEvaluation - Results available condition](https://docs.aws.amazon.com/connect/latest/APIReference/OnContactEvaluationSubmit.html#ContactEvaluation-results)

**Parameters that represent the question:**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is the question reference ID. 
+ ComparisonValue – "\$1.ContactLens.ContactEvaluation.Question.QuestionRefId"
+ Negate – false

**Parameters that represent a numeric answer:**
+ Operator - "NumberLessOrEqualTo" \$1 "NumberGreaterOrEqualTo"
+ Operands – An array of number, array length can only be 1. Value is the answer value. 
+ ComparisonValue – "\$1.ContactLens.ContactEvaluation.Question.Answer.Value"
+ Negate – false

Following is an example for a numeric question type.

```
{
    "Operator": "AND",
    "Operands": [
        {
            "Operator": "EQUALS",
            "Operands": ["11111111-1234-5678-9123-12345678012"],
            "ComparisonValue": "$.ContactLens.ContactEvaluation.Form.FormId",
            "Negate": false
        },
        {
            "Operator": "EQUALS",
            "Operands": ["s12345678"],
            "ComparisonValue": "$.ContactLens.ContactEvaluation.Question.QuestionRefId",
            "Negate":false
        },
        {
            "Operator": "NumberLessOrEqualTo",
            "Operands": [5],
            "ComparisonValue": "$.ContactLens.ContactEvaluation.Question.Answer.Value",
            "Negate":false
        }
    ]
}
```

**Parameters that represent a single select answer:**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is the answer reference ID.
+ ComparisonValue – "\$1.ContactLens.ContactEvaluation.Question.Answer.ValueRefId"
+ Negate – true/false. If set to true, it means *The answer is not equal to the answer reference ID specified in the Operands*.

Following is an example for single select question type.

```
{
    "Operator": "AND",
    "Operands": [
        {
            "Operator": "EQUALS",
            "Operands": ["11111111-1234-5678-9123-12345678012"],
            "ComparisonValue": "$.ContactLens.ContactEvaluation.Form.FormId",
            "Negate": false
        },
        {
            "Operator": "EQUALS",
            "Operands": ["q12345678"],
            "ComparisonValue": "$.ContactLens.ContactEvaluation.Question.QuestionRefId",
            "Negate":false
        },
        { // for single select question type
            "Operator": "EQUALS",
            "Operands": ["o12345678"],
            "ComparisonValue": "$.ContactLens.ContactEvaluation.Question.Answer.ValueRefId",
            "Negate":false
       },
    ]
}
```

## ContactEvaluation - agent condition


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands – A list of agent IDs. 
+ ComparisonValue – "\$1.ContactLens.ContactEvaluation.Agent.AgentId"
+ Negate – false

## ContactEvaluation - queue condition


**Parameters**
+ Operator – "EQUALS"
+ Operands – No value 
+ ComparisonValue – "\$1.ContactLens.ContactEvaluation.Queue.QueueId"
+ Negate – False

## ContactEvaluation - contact attributes condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is the contact attribute value.
+ ComparisonValue – "\$1.ContactLens.ContactEvaluation.ContactAttribute.*YOUR\$1ATTRIBUTE\$1KEY*"
+ Negate – true/false. If set to true, it means *YOUR\$1ATTRIBUTE\$1KEY* does not equal to the attribute value specified in the Operands.

# OnPostCallAnalysisAvailable


## Agent Hierarchy


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands - Agent hierarchy ARNs.
+ ComparisonValue - "\$1.ContactLens.PostCall.Agent.HierarchyGroup.ARN"
+ Negate - False

## NonTalkTimePct


**Parameters**
+ Operator - "NumberLessOrEqualTo" \$1 "NumberGreaterOrEqualTo"
+ Operands - An array of numbers, array length can only be 1. Value is an integer between 0 and 100.
+ ComparisonValue - "\$1.ContactLens.PostCall.Agent.HierarchyGroup.ARN"
+ Negate - False

## Customer Hold Duration Pct


**Parameters**
+ Operator - "NumberLessOrEqualTo" \$1 "NumberGreaterOrEqualTo"
+ Operands - An array of number, array length can only be 1. Value is an integer between 0 and 100.
+ ComparisonValue - '\$1.ContactLens.PostCall.Agent.CustomerHoldDurationPct'
+ Negate - False.

## Initiation Method


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands - A validated enum set of possible values. Possible values are as follows:
  + 'INBOUND'
  + 'OUTBOUND'
  + 'TRANSFER'
  + 'QUEUE\$1TRANSFER'
  + 'CALLBACK'
  + 'API'
  + 'DISCONNECT'
+ ComparisonValue - '\$1.ContactLens.PostCall.InitiationMethod'
+ Negate - False

## DisconnectReason


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands - A validated enum set of possible values. Possible values are as follows:
  + 'TELECOM\$1BUSY'
  + 'TELECOM\$1NUMBER\$1INVALID'
  + 'TELECOM\$1POTENTIAL\$1BLOCKING'
  + 'TELECOM\$1UNANSWERED'
  + 'TELECOM\$1TIMEOUT'
  + 'TELECOM\$1ORIGINATOR\$1CANCEL'
  + 'TELECOM\$1PROBLEM'
  + 'CUSTOMER\$1NEVER\$1ARRIVED'
  + 'THIRD\$1PARTY\$1DISCONNECT'
  + 'CUSTOMER\$1DISCONNECT'
  + 'AGENT\$1DISCONNECT'
  + 'BARGED'
  + 'CONTACT\$1FLOW\$1DISCONNECT'
  + 'OTHER'
  + 'OUTBOUND\$1DESTINATION\$1ENDPOINT\$1ERROR'
  + 'OUTBOUND\$1RESOURCE\$1ERROR'
  + 'OUTBOUND\$1ATTEMPT\$1FAILED'
  + 'EXPIRED'
  + 'AGENT\$1NETWORK\$1DISCONNECT'
  + 'CUSTOMER\$1CONNECTION\$1NOT\$1ESTABLISHED'
  + 'API'
  + 'IDLE\$1DISCONNECT'
  + 'SYSTEM\$1ERROR'
  + 'AGENT\$1COMPLETED'
  + 'TRANSFERRED'
  + 'DISCARDED'
+ ComparisonValue - "\$1.ContactLens.PostCall.DisconnectReason"
+ Negate - False

## Absolute Talk Time


**Parameters**
+ Operator - "NumberLessOrEqualTo" \$1 "NumberGreaterOrEqualTo"
+ Operands - An integer.
+ ComparisonValue - '\$1.ContactLens.PostCall.TalkTime.TotalTimeSecs'
+ FilterClause - 

  ```
  { // required!!
          LogicOperator: 'AND', // has to be 'AND'
          Filters: [ // only allows one of the object
            {
              Type: 'ParticipantRole',
              Data: 'AGENT', // 'AGENT' or 'CUSTOMER'
            },
          ],
        },
  ```
+ Negate - False

## Maximum (Highest) Loudness Score


**Parameters**
+ Operator - "NumberLessOrEqualTo" \$1 "NumberGreaterOrEqualTo"
+ Operands - an integer (decibels). 
+ ComparisonValue - '\$1.ContactLens.PostCall.Loudness.HighestLoudnessScore'
+ FilterClause - 

  ```
  {
          LogicOperator: 'AND', // has to be AND
          Filters: [ // only one object
            {
              Type: 'ParticipantRole',
              Data: 'CUSTOMER', // or 'AGENT'
            },
          ],
        },
  ```
+ Negate - False

## After Contact Work Duration


**Parameters**
+ Operator - "NumberLessOrEqualTo" \$1 "NumberGreaterOrEqualTo"
+ Operands - A positive integer or zero.
+ ComparisonValue - '\$1.ContactLens.PostCall.Agent.AfterContactWorkDurationSecs'
+ Negate - False

## Routing profile


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands - Routing profile ARNs:
+ ComparisonValue - "\$1.ContactLens.PostCall.Agent.RoutingProfile"
+ Negate - False

## PotentialDisconnectIssue


**Parameters**
+ Operator - "CONTAINS\$1ANY" \$1 "EQUALS"
+ Operands - A validated enum of possible values.
+ ComparisonValue - '\$1.ContactLens.PostCall.PotentialDisconnectIssue'
+ Negate - False.

## Custom User-Defined Segment Attribute


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands - A list of segment attribute values. The values must be a value in the pre-defined attribute resource.
+ ComparisonValue - "\$1.ContactLens.ContactEvaluation.SegmentAttributes.UserDefined.[KEY]"

  The KEY must be an instance pre-defined attribute resource.
+ Negate - False or True

## Connect AI Agent


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands - A list of strings. Strings are either a list of different UUIDs by themselves or a list of strings prefixed with the same UUID, with different possible version numbers uuid:2 and uuid:3. For example:
  + Different UUIDs by themselves: ['30682191-2312-4c27-9fc1-752e7a399d52', '2b81c7d5-85bc-459f-b605-0f5280a4301e']
  + Prefixed with the same UUID with different possible version numbers: ['30682191-2312-4c27-9fc1-752e7a399d52:1', '30682191-2312-4c27-9fc1-752e7a399d52:2']
+ ComparisonValue - '\$1.ContactLens.PostCall.AiAgent.IdWithVersion'
+ FilterClause - 

  ```
  [
            { // REQUIRED filter 
              Type: 'AiAgentUseCase',
              Data: {
                Value: 'SelfService', // or 'AgentAssistance'
              },
            },
            { // OPTIONAL filter
              Type: 'AiAgentEscalatedToHuman',
              Data: 'TRUE', // or 'FALSE'
            },
          ],
        },
  ```
+ Negate - False

## PostCall words or phrases - Exact match


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands – A list of strings
+ ComparisonValue – "\$1.ContactLens.PostCall.ExactMatch.Transcript"
+ FilterClause –

  ```
  {
      "LogicOperator": "AND", // Only "AND" is supported
      "Filters": [
          {
              "Type": "PostCallContactPeriodSeconds", // Optional filter type. If omitted, the rule applies to the full contact
              "Data": { // Either "First" or "Last" needs to be specified. 
                  "First": number
               }
          },
          {
              "Type": "ParticipantRole",
              "Data": "CUSTOMER" | "AGENT" | "ANY"
          }
      ]
  }
  ```
+ Negate - true or false. If set to true, it means *If transcript does not contain any of the words mentioned in the Operands*.

## PostCall words or phrases - Semantic match


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands – A list of strings
+ ComparisonValue – "\$1.ContactLens.PostCall.SemanticMatch.Transcript"
+ FilterClause –

  ```
  {
      "LogicOperator": "AND", // Only "AND" is supported
      "Filters": [
          {
              "Type": "PostCallContactPeriodSeconds", // Optional filter type. If omitted, the rule applies to the full contact
              "Data": { // Either "First" or "Last" needs to be specified. 
                  "First": number
               }
          },
          {
              "Type": "ParticipantRole",
              "Data": "CUSTOMER" | "AGENT" | "ANY"
          }
      ]
  }
  ```
+ Negate - true or false. If set to true, it means *If transcript does not contain any of the words mentioned in the Operands*.

## PostCall natural language - Semantic match


**Parameters**
+ Operator - "EQUALS"
+ Operands – A list with a single string
+ ComparisonValue – ""\$1.ContactLens.PostCall.SemanticMatch.Phrase"
+ FilterClause –

  ```
  {
       Operator: "EQUALS",
       Operands: [
            "Customer called to change their address and agent proceeded with the address change during the call."
       ],
       ComparisonValue: "$.ContactLens.PostCall.SemanticMatch.Phrase",
       Negate: true or false
  },
  ```
+ Negate - true or false. If set to true, it means *If transcript does not contain any of the words mentioned in the Operands*.

## PostCall words or phrases - Pattern match


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands – A list of pattern match objects. See [PatternMatch Operands](https://docs.aws.amazon.com/connect/latest/adminguide/patternmatch-operands.html). 
+ ComparisonValue – "\$1.ContactLens.PostCall.PatternMatch.Transcript"
+ FilterClause –

  ```
  {
      "LogicOperator": "AND", // Only "AND" is supported
      "Filters": [
          {
              "Type": "PostCallContactPeriodSeconds", // Optional filter type. If omitted, the rule applies to the full contact
              "Data": { // Either "First" or "Last" needs to be specified. 
                  "First": number
               }
          },
          {
              "Type": "ParticipantRole",
              "Data": "CUSTOMER" | "AGENT" | "ANY"
          },
          {
              "Type": "PatternMatchLanguageFilter",
              "Data": "EN"|"ES"|"AR"|"DE"|"FR"|"HI"|"IT"|"PT"|"KO"|"JA"|"ZH"
          }
      ]
  }
  ```
+ Negate - true or false. If set to true, it means *If transcript does not contain any of the words mentioned in the Operands*.

## PostCall agent condition


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands – A list of agent IDs
+ ComparisonValue – "\$1.ContactLens.PostCall.Agent.AgentId"
+ Negate - false

## PostCall queue condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – No value.
+ ComparisonValue – "\$1.ContactLens.PostCall.Queue.QueueId"
+ Negate - False

## PostCall contact attributes condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is the contact attribute value. 
+ ComparisonValue – "\$1.ContactLens.PostCall.ContactAttribute.*YOUR\$1ATTRIBUTE\$1KEY*"
+ Negate - true/false. If set to true, it means **YOUR\$1ATTRIBUTE\$1KEY* does not equal to the attribute value specified in the Operands. *.

## PostCall sentiment state condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is one of "POSITIVE", "NEGATIVE", "NEUTRAL". 
+ ComparisonValue – "\$1.ContactLens.PostCall.Sentiment.State"
+ FilterClause – 

  ```
  {
      "LogicOperator": "AND", // Only "AND" is supported
      "Filters": [
          {
              "Type": "ParticipantRole",
              "Data": "CUSTOMER" | "AGENT" | "ANY"
          },
      ]
  }
  ```
+ Negate - false

## PostCall sentiment overall score condition


**Parameters**
+ Operator - "NumberLessOrEqualTo \$1 "NumberGreaterOrEqualTo"
+ Operands – An array of number, array length can only be 1. Value is an integer between -5 and 5, inclusive. 
+ ComparisonValue – "\$1.ContactLens.PostCall.Sentiment.OverallScore"
+ FilterClause – 

  ```
  {
      "LogicOperator": "AND", // Only "AND" is supported
      "Filters": [
          {
              "Type": "ParticipantRole",
              "Data": "CUSTOMER" | "AGENT" | "ANY"
          },
      ]
  }
  ```
+ Negate - false

## PostCall sentiment score shift condition


PostCall sentiment score shift condition has a compound condition format where Operator is an AND condition and its operands consist of two conditions that represent beginning and end score respectively. 

**Parameters that represent the beginning score**
+ Operator - "NumberLessOrEqualTo \$1 "NumberGreaterOrEqualTo"
+ Operands – An array of number, array length can only be 1. Value is an integer between -5 and 5, inclusive. 
+ ComparisonValue – "\$1.ContactLens.PostCall.Sentiment.Score.Beginning"
+ FilterClause – 

  ```
  {
      "LogicOperator": "AND", // Only "AND" is supported
      "Filters": [
          {
              "Type": "ParticipantRole",
              "Data": "CUSTOMER" | "AGENT" | "ANY"
          },
      ]
  }
  ```
+ Negate - false

**Parameters that represent the end score**
+ Operator - "NumberLessOrEqualTo \$1 "NumberGreaterOrEqualTo"
+ Operands – An array of number, array length can only be 1. Value is an integer between -5 and 5, inclusive. 
+ ComparisonValue – "\$1.ContactLens.PostCall.Sentiment.Score.End"
+ FilterClause – 

  ```
  {
      "LogicOperator": "AND", // Only "AND" is supported
      "Filters": [
          {
              "Type": "ParticipantRole",
              "Data": "CUSTOMER" | "AGENT" | "ANY"
          },
      ]
  }
  ```
+ Negate - false

Following is an example:

```
{
        "Operator": "AND",
        "Operands": [
          {
            "Operator": "NumberGreaterOrEqualTo",
            "Operands": [
              2
            ],
            "ComparisonValue": "$.ContactLens.PostCall.Sentiment.Score.Beginning",
            "FilterClause": {
              "LogicOperator": "AND",
              "Filters": [
                {
                  "Type": "ParticipantRole",
                  "Data": "AGENT"
                }
              ]
            },
            "Negate": false
          },
          {
            "Operator": "NumberGreaterOrEqualTo",
            "Operands": [
              3
            ],
            "ComparisonValue": "$.ContactLens.PostCall.Sentiment.Score.End",
            "FilterClause": {
              "LogicOperator": "AND",
              "Filters": [
                {
                  "Type": "ParticipantRole",
                  "Data": "AGENT"
                }
              ]
            },
            "Negate": false
          }
        ]
      }
```

**Parameters for overall score**
+ Operator - "NumberLessOrEqualTo \$1 "NumberGreaterOrEqualTo"
+ Operands – An array of number, array length can only be 1. Value is an integer between -5 and 5, inclusive. 
+ ComparisonValue – "\$1.ContactLens.PostCall.Sentiment.OverallScore"
+ FilterClause – 

  ```
  {
      "LogicOperator": "AND", // Only "AND" is supported
      "Filters": [
          {
              "Type": "ParticipantRole",
              "Data": "CUSTOMER" | "AGENT" | "ANY"
          },
      ]
  }
  ```
+ Negate - false

## PostCall total non-talk time condition


**Parameters**
+ Operator - "NumberLessOrEqualTo \$1 "NumberGreaterOrEqualTo"
+ Operands – An array of number, array length can only be 1. Value is an integer with minimum value 1. 
+ ComparisonValue – "\$1.ContactLens.PostCall.NonTalkTime.TotalTimeSecs"
+ Negate - false

## PostCall longest non-talk time condition


**Parameters**
+ Operator - "NumberLessOrEqualTo" \$1 "NumberGreaterOrEqualTo"
+ Operands – An array of number, array length can only be 1. Value is an integer with minimum value 1. 
+ ComparisonValue – "\$1.ContactLens.PostCall.NonTalkTime.LongestTimeSecs"
+ Negate - false

## PostCall interruption condition


**Parameters**
+ Operator - "NumberLessOrEqualTo" \$1 "NumberGreaterOrEqualTo"
+ Operands – An array of number, array length can only be 1. Value is an integer with minimum value 1. 
+ ComparisonValue – "\$1.ContactLens.PostCall.Interruptions.Instances"
+ Negate - false

## PostCall total hold time condition


**Parameters**
+ Operator - "NumberLessOrEqualTo" \$1 "NumberGreaterOrEqualTo"
+ Operands – An array of number, array length can only be 1. Value is an integer with minimum value 1. 
+ ComparisonValue – "\$1.ContactLens.PostCall.Agent.CustomerHoldDurationSecs"
+ Negate - false

## PostCall longest hold time condition


**Parameters**
+ Operator - "NumberLessOrEqualTo" \$1 "NumberGreaterOrEqualTo"
+ Operands – An array of number, array length can only be 1. Value is an integer with minimum value 1. 
+ ComparisonValue – "\$1.ContactLens.PostCall.Agent.LongestHoldDurationSecs"
+ Negate - false

## PostCall number of holds condition


**Parameters**
+ Operator - "NumberLessOrEqualTo" \$1 "NumberGreaterOrEqualTo"
+ Operands – An array of number, array length can only be 1. Value is an integer with minimum value 1. 
+ ComparisonValue – "\$1.ContactLens.PostCall.Agent.NumberOfHolds"
+ Negate - false

## PostCall agent interaction duration condition


**Parameters**
+ Operator - "NumberLessOrEqualTo" \$1 "NumberGreaterOrEqualTo"
+ Operands – An array of number, array length can only be 1. Value is an integer with minimum value 1. 
+ "\$1.ContactLens.PostCall.Agent.AgentInteractionDurationSecs"
+ Negate - false

# OnRealTimeCallAnalysisAvailable


## RealTimeCall words or phrases - Exact match


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands – A list of strings
+ ComparisonValue – "\$1.ContactLens.RealTimeCall.ExactMatch.Transcript"
+ FilterClause –

  ```
  {
      "LogicOperator": "AND", // Only "AND" is supported
      "Filters": [
          {
              "Type": "ParticipantRole",
              "Data": "CUSTOMER" | "AGENT" | "ANY"
          }
      ]
  }
  ```
+ Negate - false.

## RealTimeCall words or phrases - Pattern match


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands – A list of pattern match objects. See [PatternMatch Operands](https://docs.aws.amazon.com/connect/latest/adminguide/patternmatch-operands.html). 
+ ComparisonValue – "\$1.ContactLens.RealTimeCall.PatternMatch.Transcript"
+ FilterClause –

  ```
  {
      "LogicOperator": "AND", // Only "AND" is supported
      "Filters": [
          {
              "Type": "ParticipantRole",
              "Data": "CUSTOMER" | "AGENT" | "ANY"
          },
          {
              "Type": "PatternMatchLanguageFilter",
              "Data": "EN"|"ES"|"AR"|"DE"|"FR"|"HI"|"IT"|"PT"|"KO"|"JA"|"ZH"
          }
      ]
  }
  ```
+ Negate - false

## RealTimeCall agent condition


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands – A list of agent IDs 
+ ComparisonValue – "\$1.ContactLens.RealTimeCall.Agent.AgentId"
+ Negate - false

## RealTimeCall queue condition


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands – A list of queue IDs 
+ ComparisonValue – "\$1.ContactLens.RealTimeCall.Queue.QueueId"
+ Negate - true/false. If set to true, it means *If queue is not any of the queues mentioned in the Operands*.

## RealTimeCall contact attributes condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is the contact attribute value. 
+ ComparisonValue – "\$1.ContactLens.RealTimeCall.ContactAttribute.*YOUR\$1ATTRIBUTE\$1KEY*"
+ Negate - true/false. If set to true, it means **YOUR\$1ATTRIBUTE\$1KEY* does not equal to the attribute value specified in the Operands *.

## RealTimeCall sentiment state condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is one of "POSITIVE", "NEGATIVE", "NEUTRAL". 
+ ComparisonValue – "\$1.ContactLens.RealTimeCall.Sentiment.State"
+ FilterClause – 

  ```
  {
      "LogicOperator": "AND", // Only "AND" is supported
      "Filters": [
          {
              "Type": "ParticipantRole",
              "Data": "CUSTOMER" | "AGENT" | "ANY"
          },
          {
              "Type": "RealTimeCallContactPeriodSeconds",
              "Data": {
                  "Past": number
              }
          }
      ]
  }
  ```
+ Negate - false

# OnPostChatAnalysisAvailable


## Agent Hierarchy


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands - Agent hierarchy ARNs.
+ ComparisonValue - "\$1.ContactLens.PostChat.Agent.HierarchyGroup.ARN"
+ Negate - False

## Initiation Method


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands - A validated enum set of possible values.Possible values are as follows:
  + 'INBOUND'
  + 'OUTBOUND'
  + 'TRANSFER'
  + 'QUEUE\$1TRANSFER'
  + 'CALLBACK'
  + 'API'
  + 'DISCONNECT'
+ ComparisonValue - '\$1.ContactLens.PostChat.InitiationMethod'
+ Negate - False

## DisconnectReason


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands - A validated enum set of possible values. Possible values are as follows:
  + 'TELECOM\$1BUSY'
  + 'TELECOM\$1NUMBER\$1INVALID'
  + 'TELECOM\$1POTENTIAL\$1BLOCKING'
  + 'TELECOM\$1UNANSWERED'
  + 'TELECOM\$1TIMEOUT'
  + 'TELECOM\$1ORIGINATOR\$1CANCEL'
  + 'TELECOM\$1PROBLEM'
  + 'CUSTOMER\$1NEVER\$1ARRIVED'
  + 'THIRD\$1PARTY\$1DISCONNECT'
  + 'CUSTOMER\$1DISCONNECT'
  + 'AGENT\$1DISCONNECT'
  + 'BARGED'
  + 'CONTACT\$1FLOW\$1DISCONNECT'
  + 'OTHER'
  + 'OUTBOUND\$1DESTINATION\$1ENDPOINT\$1ERROR'
  + 'OUTBOUND\$1RESOURCE\$1ERROR'
  + 'OUTBOUND\$1ATTEMPT\$1FAILED'
  + 'EXPIRED'
  + 'AGENT\$1NETWORK\$1DISCONNECT'
  + 'CUSTOMER\$1CONNECTION\$1NOT\$1ESTABLISHED'
  + 'API'
  + 'IDLE\$1DISCONNECT'
  + 'SYSTEM\$1ERROR'
  + 'AGENT\$1COMPLETED'
  + 'TRANSFERRED'
  + 'DISCARDED'
+ ComparisonValue - "\$1.ContactLens.PostChat.DisconnectReason"
+ Negate - False

## After Contact Work Duration


**Parameters**
+ Operator - "NumberGreaterOrEqualTo" \$1 "NumberLessOrEqualTo"
+ Operands - A positive integer or zero.
+ ComparisonValue - '\$1.ContactLens.PostChat.Agent.AfterContactWorkDurationSecs'
+ Negate - False

## Routing Profile


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands - Routing profile ARNs.
+ ComparisonValue - "\$1.ContactLens.PostChat.Agent.RoutingProfile"
+ Negate - False

## PotentialDisconnectIssue


**Parameters**
+ Operator - "CONTAINS\$1ANY" where it is matched by a possible operand or "EQUALS" where the operand has to have no value.
+ Operands - A validated enum of possible values or no value.
+ ComparisonValue - '\$1.ContactLens.PostChat.PotentialDisconnectIssue'
+ Negate - False

## Custom User-Defined Segment Attribute


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands - A list of segment attribute values. The values must be a value in the pre-defined attribute resource.
+ ComparisonValue - "\$1.ContactLens.ContactEvaluation.SegmentAttributes.UserDefined.[KEY]"

  The KEY must be an instance pre-defined attribute resource.
+ Negate - False

## Connect AI Agent


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands - A list of strings. Strings are either a list of different UUIDs by themselves or a list of strings prefixed with the same UUID, with different possible version numbers uuid:2 and uuid:3. For example:
  + Different UUIDs by themselves: ['30682191-2312-4c27-9fc1-752e7a399d52', '2b81c7d5-85bc-459f-b605-0f5280a4301e']
  + Prefixed with the same UUID with different possible version numbers: ['30682191-2312-4c27-9fc1-752e7a399d52:1', '30682191-2312-4c27-9fc1-752e7a399d52:2']
+ ComparisonValue - '\$1.ContactLens.PostChat.AiAgent.IdWithVersion'
+ FilterClause - 

  ```
  {
          LogicOperator: 'AND', // has to be 'AND'
          Filters: [
            { // REQUIRED filter 
              Type: 'AiAgentUseCase',
              Data: {
                Value: 'SelfService', // or 'AgentAssistance'
              },
            },
            { // OPTIONAL filter
              Type: 'AiAgentEscalatedToHuman',
              Data: 'TRUE', // or 'FALSE'
            },
          ],
        },
  ```
+ Negate - False

## PostChat words or phrases - Exact match


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands – A list of strings
+ ComparisonValue – "\$1.ContactLens.PostChat.ExactMatch.Transcript"
+ FilterClause –

  ```
  {
      "LogicOperator": "AND", // Only "AND" is supported
      "Filters": [
          {
              "Type": "PostChatContactPeriodSeconds", // Optional filter type. If omitted, the rule applies to the full contact
              "Data": { // Either "First" or "Last" needs to be specified. 
                  "First": number
               }
          },
          {
              "Type": "ParticipantRole",
              "Data": "CUSTOMER" | "AGENT" | "ANY"
          }
      ]
  }
  ```
+ Negate - true or false. If set to true, it means *If transcript does not contain any of the words mentioned in the Operands*.

## PostChat words or phrases - Semantic match


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands – A list of strings
+ ComparisonValue – "\$1.ContactLens.PostChat.SemanticMatch.Transcript"
+ FilterClause –

  ```
  {
      "LogicOperator": "AND", // Only "AND" is supported
      "Filters": [
          {
              "Type": "PostChatContactPeriodSeconds", // Optional filter type. If omitted, the rule applies to the full contact
              "Data": { // Either "First" or "Last" needs to be specified. 
                  "First": number
               }
          },
          {
              "Type": "ParticipantRole",
              "Data": "CUSTOMER" | "AGENT" | "ANY"
          }
      ]
  }
  ```
+ Negate - true or false. If set to true, it means *If transcript does not contain any of the words mentioned in the Operands*.

## PostChat natural language - Semantic match


**Parameters**
+ Operator - "EQUALS"
+ Operands – A list with a single string
+ ComparisonValue – ""\$1.ContactLens.PostChat.SemanticMatch.Phrase"
+ FilterClause –

  ```
  {
       Operator: "EQUALS",
       Operands: [
            "Customer called to change their address and agent proceeded with the address change during the call."
       ],
       ComparisonValue: "$.ContactLens.PostChat.SemanticMatch.Phrase",
       Negate: true or false
  },
  ```
+ Negate - true or false. If set to true, it means *If transcript does not contain any of the words mentioned in the Operands*.

## PostChat words or phrases - Pattern match


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands – A list of pattern match objects. See [PatternMatch Operands](https://docs.aws.amazon.com/connect/latest/adminguide/patternmatch-operands.html).
+ ComparisonValue – "\$1.ContactLens.PostChat.PatternMatch.Transcript"
+ FilterClause –

  ```
  {
      "LogicOperator": "AND", // Only "AND" is supported
      "Filters": [
          {
              "Type": "PostChatContactPeriodSeconds", // Optional filter type. If omitted, the rule applies to the full contact
              "Data": { // Either "First" or "Last" needs to be specified. 
                  "First": number
               }
          },
          {
              "Type": "ParticipantRole",
              "Data": "CUSTOMER" | "AGENT" | "ANY"
          },
          {
              "Type": "PatternMatchLanguageFilter",
              "Data": "EN"|"ES"|"AR"|"DE"|"FR"|"HI"|"IT"|"PT"|"KO"|"JA"|"ZH"
          }
      ]
  }
  ```
+ Negate - true or false. If set to true, it means *If the transcript does not contain any of the words mentioned in the Operands*.

## PostChat agent condition


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands – A list of agent IDs 
+ ComparisonValue – "\$1.ContactLens.PostChat.Agent.AgentId"
+ Negate - false

## PostChat queue condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – No value
+ ComparisonValue – "\$1.ContactLens.PostChat.Queue.QueueId"
+ Negate - False

## PostChat contact attributes condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is the contact attribute value. 
+ ComparisonValue – "\$1.ContactLens.PostChat.ContactAttribute.*YOUR\$1ATTRIBUTE\$1KEY*"
+ Negate - true/false. If set to true, it means **YOUR\$1ATTRIBUTE\$1KEY* does not equal to the attribute value specified in the Operands *.

## PostChat sentiment state condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is one of "POSITIVE", "NEGATIVE", "NEUTRAL". 
+ ComparisonValue – "\$1.ContactLens.PostChat.Sentiment.State"
+ FilterClause – 

  ```
  {
      "LogicOperator": "AND", // Only "AND" is supported
      "Filters": [
          {
              "Type": "ParticipantRole",
              "Data": "CUSTOMER" | "AGENT" | "ANY"
          },
      ]
  }
  ```
+ Negate - false

## PostChat sentiment overall score condition


**Parameters**
+ Operator - "NumberLessOrEqualTo" \$1 "NumberGreaterOrEqualTo"
+ Operands – An array of number, array length can only be 1. Value is an integer between -5 and 5, inclusive. 
+ ComparisonValue – "\$1.ContactLens.PostChat.Sentiment.OverallScore"
+ FilterClause – 

  ```
  {
      "LogicOperator": "AND", // Only "AND" is supported
      "Filters": [
          {
              "Type": "ParticipantRole",
              "Data": "CUSTOMER" | "AGENT" | "ANY"
          },
      ]
  }
  ```
+ Negate - false

## Postchat sentiment score shift condition


PostChat sentiment score shift condition has a compound condition format where Operator is an AND condition and its operands consist of two conditions that represent beginning and end score respectively. 

**Parameters that represent the beginning score**
+ Operator - "NumberLessOrEqualTo" \$1 "NumberGreaterOrEqualTo"
+ Operands – An array of number, array length can only be 1. Value is an integer between -5 and 5, inclusive. 
+ ComparisonValue – "\$1.ContactLens.PostChat.Sentiment.Score.Beginning"
+ FilterClause – 

  ```
  {
      "LogicOperator": "AND", // Only "AND" is supported
      "Filters": [
          {
              "Type": "ParticipantRole",
              "Data": "CUSTOMER" | "AGENT" | "ANY"
          },
      ]
  }
  ```
+ Negate - false

**Parameters that represent the end score**
+ Operator - "NumberLessOrEqualTo" \$1 "NumberGreaterOrEqualTo"
+ Operands – An array of number, array length can only be 1. Value is an integer between -5 and 5, inclusive. 
+ ComparisonValue – "\$1.ContactLens.PostChat.Sentiment.Score.End"
+ FilterClause – 

  ```
  {
      "LogicOperator": "AND", // Only "AND" is supported
      "Filters": [
          {
              "Type": "ParticipantRole",
              "Data": "CUSTOMER" | "AGENT" | "ANY"
          },
      ]
  }
  ```
+ Negate - false

Following is an example:

```
{
        "Operator": "AND",
        "Operands": [
          {
            "Operator": "NumberGreaterOrEqualTo",
            "Operands": [
              2
            ],
            "ComparisonValue": "$.ContactLens.PostChat.Sentiment.Score.Beginning",
            "FilterClause": {
              "LogicOperator": "AND",
              "Filters": [
                {
                  "Type": "ParticipantRole",
                  "Data": "AGENT"
                }
              ]
            },
            "Negate": false
          },
          {
            "Operator": "NumberGreaterOrEqualTo",
            "Operands": [
              3
            ],
            "ComparisonValue": "$.ContactLens.PostChat.Sentiment.Score.End",
            "FilterClause": {
              "LogicOperator": "AND",
              "Filters": [
                {
                  "Type": "ParticipantRole",
                  "Data": "AGENT"
                }
              ]
            },
            "Negate": false
          }
        ]
      }
```

## PostChat agent first response time condition


**Parameters**
+ Operator - "NumberLessOrEqualTo" \$1 "NumberGreaterOrEqualTo"
+ Operands – An array of number, array length can only be 1. Value is an integer with minimum value 1. 
+ ComparisonValue – "\$1.ContactLens.PostChat.ResponseTime.Agent.FirstResponseTimeSecs"
+ Negate - false

## PostChat agent average response time condition


**Parameters**
+ Operator - "NumberLessOrEqualTo" \$1 "NumberGreaterOrEqualTo"
+ Operands – An array of number, array length can only be 1. Value is an integer with minimum value 1. 
+ ComparisonValue – "\$1.ContactLens.PostChat.ResponseTime.Agent.AverageTimeSecs"
+ Negate - false

## PostChat agent longest response time condition


**Parameters**
+ Operator - "NumberLessOrEqualTo" \$1 "NumberGreaterOrEqualTo"
+ Operands – An array of number, array length can only be 1. Value is an integer with minimum value 1. 
+ ComparisonValue – "\$1.ContactLens.PostChat.ResponseTime.Agent.LongestTimeSecs"
+ Negate - false

## PostChat agent interaction duration condition


**Parameters**
+ Operator - "NumberLessOrEqualTo" \$1 "NumberGreaterOrEqualTo"
+ Operands – An array of number, array length can only be 1. Value is an integer with minimum value 1. 
+ "\$1.ContactLens.PostChat.Agent.AgentInteractionDurationSecs"
+ Negate - false

# OnZendeskTicketCreate


## Type condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is one of "question", "incident", "problem", "task"
+ ComparisonValue – "\$1.ThirdParty.Zendesk.TicketCreate.Type"
+ Negate - true or false. If set to true, it means *If ticket type does not equal to the type specified in the Operands*.

## Priority condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is one of "low", "normal", "high", "urgent"
+ ComparisonValue – "\$1.ThirdParty.Zendesk.TicketCreate.Priority"
+ Negate - true or false. If set to true, it means *If ticket priority does not equal to the priority specified in the Operands*.

## Status condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is one of "open", "pending", "solved", "close", "hold"
+ ComparisonValue – "\$1.ThirdParty.Zendesk.TicketCreate.Status"
+ Negate - true or false. If set to true, it means *If ticket status does not equal to the status specified in the Operands.*.

## RequesterId condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is a requester id.
+ ComparisonValue – "\$1.ThirdParty.Zendesk.TicketCreate.RequesterId"
+ Negate - true or false. If set to true, it means *If requester id does not equal to the requester id specified in the Operands.*.

## SubmitterId condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is a submitter id.
+ ComparisonValue – "\$1.ThirdParty.Zendesk.TicketCreate.SubmitterId"
+ Negate - true or false. If set to true, it means *If submitter id does not equal to the submitter id specified in the Operands.*.

## AssigneeId condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is an assignee id.
+ ComparisonValue – "\$1.ThirdParty.Zendesk.TicketCreate.AssigneeId"
+ Negate - true or false. If set to true, it means *If assignee id does not equal to the assignee id specified in the Operands.*.

## OrganizationId condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is an organization id.
+ ComparisonValue – "\$1.ThirdParty.Zendesk.TicketCreate.OrganizationId"
+ Negate - true or false. If set to true, it means *If organization id does not equal to the organization id specified in the Operands.*.

## BrandId condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is a brand id.
+ ComparisonValue – "\$1.ThirdParty.Zendesk.TicketCreate.BrandId"
+ Negate - true or false. If set to true, it means *If brand id does not equal to the brand id specified in the Operands*.

## FormId condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is a form id.
+ ComparisonValue – "\$1.ThirdParty.Zendesk.TicketCreate.FormId"
+ Negate - true or false. If set to true, it means *If form id does not equal to the form id specified in the Operands*.

## ExternalId condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is an external id.
+ ComparisonValue – "\$1.ThirdParty.Zendesk.TicketCreate.ExternalId"
+ Negate - true or false. If set to true, it means *If external id does not equal to the external id specified in the Operands*.

## Channel condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is a channel string.
+ ComparisonValue – "\$1.ThirdParty.Zendesk.TicketCreate.Channel"
+ Negate - true or false. If set to true, it means *If channel value does not equal to the channel string specified in the Operands*.

## Tags condition


**Parameters**
+ Operator - "CONTAINS"
+ Operands – An array of string, array length can only be 1. Value is a tag string.
+ ComparisonValue – "\$1.ThirdParty.Zendesk.TicketCreate.Tags"
+ Negate - true or false. If set to true, it means *If tag value does not equal to the tag string specified in the Operands*.

# OnZendeskTicketStatusUpdate


## Type condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is one of "question", "incident", "problem", "task"
+ ComparisonValue – "\$1.ThirdParty.Zendesk.StatusUpdate.Type"
+ Negate - true or false. If set to true, it means *If ticket type does not equal to the type specified in the Operands*.

## Priority condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is one of "low", "normal", "high", "urgent"
+ ComparisonValue – "\$1.ThirdParty.Zendesk.StatusUpdate.Priority"
+ Negate - true or false. If set to true, it means *If ticket priority does not equal to the priority specified in the Operands*.

## Status condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is one of "open", "pending", "solved", "close", "hold"
+ ComparisonValue – "\$1.ThirdParty.Zendesk.StatusUpdate.Status"
+ Negate - true or false. If set to true, it means *If ticket status does not equal to the status specified in the Operands.*.

## RequesterId condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is a requester id.
+ ComparisonValue – "\$1.ThirdParty.Zendesk.StatusUpdate.RequesterId"
+ Negate - true or false. If set to true, it means *If requester id does not equal to the requester id specified in the Operands.*.

## SubmitterId condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is a submitter id.
+ ComparisonValue – "\$1.ThirdParty.Zendesk.StatusUpdate.SubmitterId"
+ Negate - true or false. If set to true, it means *If submitter id does not equal to the submitter id specified in the Operands.*.

## AssigneeId condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is an assignee id.
+ ComparisonValue – "\$1.ThirdParty.Zendesk.StatusUpdate.AssigneeId"
+ Negate - true or false. If set to true, it means *If assignee id does not equal to the assignee id specified in the Operands.*.

## OrganizationId condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is an organization id.
+ ComparisonValue – "\$1.ThirdParty.Zendesk.StatusUpdate.OrganizationId"
+ Negate - true or false. If set to true, it means *If organization id does not equal to the organization id specified in the Operands.*.

## BrandId condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is a brand id.
+ ComparisonValue – "\$1.ThirdParty.Zendesk.StatusUpdate.BrandId"
+ Negate - true or false. If set to true, it means *If brand id does not equal to the brand id specified in the Operands*.

## FormId condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is a form id.
+ ComparisonValue – "\$1.ThirdParty.Zendesk.StatusUpdate.FormId"
+ Negate - true or false. If set to true, it means *If form id does not equal to the form id specified in the Operands*.

## ExternalId condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is an external id.
+ ComparisonValue – "\$1.ThirdParty.Zendesk.StatusUpdate.ExternalId"
+ Negate - true or false. If set to true, it means *If external id does not equal to the external id specified in the Operands*.

## Channel condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is a channel string.
+ ComparisonValue – "\$1.ThirdParty.Zendesk.StatusUpdate.Channel"
+ Negate - true or false. If set to true, it means *If channel value does not equal to the channel string specified in the Operands*.

## Tags condition


**Parameters**
+ Operator - "CONTAINS"
+ Operands – An array of string, array length can only be 1. Value is a tag string.
+ ComparisonValue – "\$1.ThirdParty.Zendesk.StatusUpdate.Tags"
+ Negate - true or false. If set to true, it means *If tag value does not equal to the tag string specified in the Operands*.

# OnSalesforceCaseCreate


## AccountId condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is an account Id string. 
+ ComparisonValue – "\$1.ThirdParty.Salesforce.CaseCreate.AccountId"
+ Negate - true or false. If set to true, it means *If account id does not equal to the account id specified in the Operands*.

## Name condition


**Parameters**
+ Operator - "EQUALS" or "CONTAINS"
+ Operands – An array of string, array length can only be 1. Value is an account Id string. 
+ ComparisonValue – "\$1.ThirdParty.Salesforce.CaseCreate.Name"
+ Negate - true or false. If set to true, it means *If name does not equal to or does not contain the priority specified in the Operands*.

## Email condition


**Parameters**
+ Operator - "EQUALS" or "CONTAINS"
+ Operands – An array of string, array length can only be 1. Value is an email string. 
+ ComparisonValue – "\$1.ThirdParty.Salesforce.CaseCreate.Email"
+ Negate - true or false. If set to true, it means *If email does not equal to or does not contain the email specified in the Operands*.

## Phone condition


**Parameters**
+ Operator - "EQUALS" or "CONTAINS"
+ Operands – An array of string, array length can only be 1. Value is a phone string. 
+ ComparisonValue – "\$1.ThirdParty.Salesforce.CaseCreate.Phone"
+ Negate - true or false. If set to true, it means *If phone does not equal to or does not contain the phone specified in the Operands*.

## Company condition


**Parameters**
+ Operator - "EQUALS" or "CONTAINS"
+ Operands – An array of string, array length can only be 1. Value is a company string. 
+ ComparisonValue – "\$1.ThirdParty.Salesforce.CaseCreate.Phone"
+ Negate - true or false. If set to true, it means *If company does not equal to or does not contain the company specified in the Operands*.

## Type condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is a type string. 
+ ComparisonValue – "\$1.ThirdParty.Salesforce.CaseCreate.Type"
+ Negate - true or false. If set to true, it means *If type does not equal to the type specified in the Operands*.

## Reason condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is a reason string. 
+ ComparisonValue – "\$1.ThirdParty.Salesforce.CaseCreate.Reason"
+ Negate - true or false. If set to true, it means *If reason does not equal to the reason specified in the Operands*.

## Origin condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is an origin string. 
+ ComparisonValue – "\$1.ThirdParty.Salesforce.CaseCreate.Origin"
+ Negate - true or false. If set to true, it means *If origin does not equal to the origin specified in the Operands*.

## Subject condition


**Parameters**
+ Operator - "EQUALS" or "CONTAINS"
+ Operands – An array of string, array length can only be 1. Value is a subject string. 
+ ComparisonValue – "\$1.ThirdParty.Salesforce.CaseCreate.Subject "
+ Negate - true or false. If set to true, it means *If subject does not equal to or does not contain the subject specified in the Operands*.

## Priority condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is a priority string. 
+ ComparisonValue – "\$1.ThirdParty.Salesforce.CaseCreate.Priority"
+ Negate - true or false. If set to true, it means *If priority does not equal to the priority specified in the Operands*.

## Description condition


**Parameters**
+ Operator - "EQUALS" or "CONTAINS"
+ Operands – An array of string, array length can only be 1. Value is a description string. 
+ ComparisonValue – "\$1.ThirdParty.Salesforce.CaseCreate.Description"
+ Negate - true or false. If set to true, it means *If description does not equal to or does not contain the description specified in the Operands*.

## CustomAttribute condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of string, array length can only be 1. Value is the custom attribute value. 
+ ComparisonValue – "\$1.ThirdParty.Salesforce.CaseCreate.CustomAttribute.*YOUR\$1ATTRIBUTE\$1KEY*"
+ Negate - true or false. If set to true, it means *If custom attribute does not equal to the custom attribute specified in the Operands*.

# OnCaseCreate


## Assigned queue condition


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands – A list of queue ids
+ ComparisonValue – "\$1.Case.Fields.assigned\$1queue"
+ Negate - false

```
{
    "Operator": "CONTAINS_ANY",
    "Operands": ["queueId"], 
    "ComparisonValue": "$.Case.Fields.assigned_queue",
    "Negate": false
}
```

## Assigned user condition


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands – A list of queue ids
+ ComparisonValue – "\$1.Case.Fields.assigned\$1user"
+ Negate - false

```
{
    "Operator": "CONTAINS_ANY",
    "Operands": ["userId1, userId2"], 
    "ComparisonValue": "$.Case.Fields.assigned_user",
    "Negate": false
}
```

## Case reason condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of strings in which the array length can only be 1. The value is a case reason.
+ ComparisonValue – "\$1.Case.Fields.case\$1reason"
+ Negate - true/false

```
{
    "Operator": "EQUALS",
    "Operands": ["Refund"], 
    "ComparisonValue": "$.Case.Fields.case_reason",
    "Negate": false
}
```

## Case status condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of strings in which the array length can only be 1. The value is a case status.
+ ComparisonValue – "\$1.Case.Fields.status"
+ Negate - false

```
{
    "Operator": "EQUALS",
    "Operands": ["open"], 
    "ComparisonValue": "$.Case.Fields.status",
    "Negate": false
}
```

## Case summary condition


**Parameters**
+ Operator - “CONTAINS” \$1 “EQUALS”
+ Operands – An array of strings in which the array length can only be 1. The value is a case summary.
+ ComparisonValue – "\$1.Case.Fields.summary"
+ Negate - false

```
{
    "Operator": "EQUALS",
    "Operands": ["open"], 
    "ComparisonValue": "$.Case.Fields.summary",
    "Negate": false
}
```

## Case date/time last closed condition


**Parameters**
+ Operator - “NumberLessOrEqualTo” \$1 “NumberGreaterOrEqualTo”
+ Operands – An array of strings in which the array length can only be 1. The value is interpreted as a numeric value.
+ ComparisonValue – "\$1.Case.Fields.last\$1closed\$1datetime"
+ Negate - false

```
{
    "Operator": "NumberLessOrEqualTo",
    "Operands": ["2023-11-11T11:11:11.111111Z"], 
    "ComparisonValue": "$.Case.Fields.last_closed_datetime",
    "Negate": false
}
```

## Case date/time updated condition


**Parameters**
+ Operator - “NumberLessOrEqualTo” \$1 “NumberGreaterOrEqualTo”
+ Operands – An array of strings in which the array length can only be 1. The value is interpreted as a numeric value.
+ ComparisonValue – "\$1.Case.Fields.last\$1updated\$1datetime"
+ Negate - false

```
{
    "Operator": "NumberLessOrEqualTo",
    "Operands": ["2023-11-11T11:11:11.111111Z"], 
    "ComparisonValue": "$.Case.Fields.last_updated_datetime",
    "Negate": false
}
```

## Case date/time opened condition


**Parameters**
+ Operator - “NumberLessOrEqualTo” \$1 “NumberGreaterOrEqualTo”
+ Operands – An array of strings in which the array length can only be 1. The value is interpreted as a numeric value.
+ ComparisonValue – "\$1.Case.Fields.created\$1datetime"
+ Negate - true/false

```
{
    "Operator": "NumberLessOrEqualTo",
    "Operands": ["2023-11-11T11:11:11.111111Z"], 
    "ComparisonValue": "$.Case.Fields.created_datetime",
    "Negate": false
}
```

## Case reference number condition


**Parameters**
+ Operator - “CONTAINS” \$1 “EQUALS”
+ Operands – An array of strings in which the array length can only be 1. The value is interpreted as a numeric value.
+ ComparisonValue – "\$1.Case.Fields.reference\$1number"
+ Negate - true

```
{
    "Operator": "CONTAINS",
    "Operands": ["11111111"], 
    "ComparisonValue": "$.Case.Fields.reference_number",
    "Negate": false
}
```

## Case customer fields condition


**Parameters**
+ Operator - “CONTAINS” \$1 “EQUALS”
+ Operands – An array of strings in which the array length can only be 1.
+ ComparisonValue – "\$1.Case.Fields.custom\$1case\$1field\$1id"
+ Negate - true/false

```
{
    "Operator": "EQUALS",
    "Operands": ["vip"], 
    "ComparisonValue": "$.Case.Fields.custom_case_field_id",
    "Negate": false
}
```

## Case template condition


**Parameters**
+ Operator - “CONTAINS\$1ANY”
+ Operands – A list of template ids.
+ ComparisonValue – "\$1.Case.TemplateId"
+ Negate - true/false

```
{
"Operator": "CONTAINS_ANY",
"Operands": ["templateId"],
"ComparisonValue": "$.Case.TemplateId",
"Negate": false
}
```

# OnCaseUpdate


## Assigned queue condition


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands – A list of queue ids
+ ComparisonValue – "\$1.Case.Fields.assigned\$1queue"
+ Negate - false

```
{
    "Operator": "CONTAINS_ANY",
    "Operands": ["queueId"], 
    "ComparisonValue": "$.Case.Fields.assigned_queue",
    "Negate": false
}
```

## Assigned user condition


**Parameters**
+ Operator - "CONTAINS\$1ANY"
+ Operands – A list of queue ids
+ ComparisonValue – "\$1.Case.Fields.assigned\$1user"
+ Negate - false

```
{
    "Operator": "CONTAINS_ANY",
    "Operands": ["userId1, userId2"], 
    "ComparisonValue": "$.Case.Fields.assigned_user",
    "Negate": false
}
```

## Case reason condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of strings in which the array length can only be 1. The value is a case reason.
+ ComparisonValue – "\$1.Case.Fields.case\$1reason"
+ Negate - true/false

```
{
    "Operator": "EQUALS",
    "Operands": ["Refund"], 
    "ComparisonValue": "$.Case.Fields.case_reason",
    "Negate": false
}
```

## Case status condition


**Parameters**
+ Operator - "EQUALS"
+ Operands – An array of strings in which the array length can only be 1. The value is a case status.
+ ComparisonValue – "\$1.Case.Fields.status"
+ Negate - false

```
{
    "Operator": "EQUALS",
    "Operands": ["open"], 
    "ComparisonValue": "$.Case.Fields.status",
    "Negate": false
}
```

## Case summary condition


**Parameters**
+ Operator - “CONTAINS” \$1 “EQUALS”
+ Operands – An array of strings in which the array length can only be 1. The value is a case summary.
+ ComparisonValue – "\$1.Case.Fields.summary"
+ Negate - false

```
{
    "Operator": "EQUALS",
    "Operands": ["open"], 
    "ComparisonValue": "$.Case.Fields.summary",
    "Negate": false
}
```

## Case date/time last closed condition


**Parameters**
+ Operator - “NumberLessOrEqualTo” \$1 “NumberGreaterOrEqualTo”
+ Operands – An array of strings in which the array length can only be 1. The value is interpreted as a numeric value.
+ ComparisonValue – "\$1.Case.Fields.last\$1closed\$1datetime"
+ Negate - false

```
{
    "Operator": "NumberLessOrEqualTo",
    "Operands": ["2023-11-11T11:11:11.111111Z"], 
    "ComparisonValue": "$.Case.Fields.last_closed_datetime",
    "Negate": false
}
```

## Case date/time updated condition


**Parameters**
+ Operator - “NumberLessOrEqualTo” \$1 “NumberGreaterOrEqualTo”
+ Operands – An array of strings in which the array length can only be 1. The value is interpreted as a numeric value.
+ ComparisonValue – "\$1.Case.Fields.last\$1updated\$1datetime"
+ Negate - false

```
{
    "Operator": "NumberLessOrEqualTo",
    "Operands": ["2023-11-11T11:11:11.111111Z"], 
    "ComparisonValue": "$.Case.Fields.last_updated_datetime",
    "Negate": false
}
```

## Case date/time opened condition


**Parameters**
+ Operator - “NumberLessOrEqualTo” \$1 “NumberGreaterOrEqualTo”
+ Operands – An array of strings in which the array length can only be 1. The value is interpreted as a numeric value.
+ ComparisonValue – "\$1.Case.Fields.created\$1datetime"
+ Negate - true/false

```
{
    "Operator": "NumberLessOrEqualTo",
    "Operands": ["2023-11-11T11:11:11.111111Z"], 
    "ComparisonValue": "$.Case.Fields.created_datetime",
    "Negate": false
}
```

## Case reference number condition


**Parameters**
+ Operator - “CONTAINS” \$1 “EQUALS”
+ Operands – An array of strings in which the array length can only be 1. The value is interpreted as a numeric value.
+ ComparisonValue – "\$1.Case.Fields.reference\$1number"
+ Negate - true

```
{
    "Operator": "CONTAINS",
    "Operands": ["11111111"], 
    "ComparisonValue": "$.Case.Fields.reference_number",
    "Negate": false
}
```

## Case customer fields condition


**Parameters**
+ Operator - “CONTAINS” \$1 “EQUALS”
+ Operands – An array of strings in which the array length can only be 1.
+ ComparisonValue – "\$1.Case.Fields.custom\$1case\$1field\$1id"
+ Negate - true/false

```
{
    "Operator": "EQUALS",
    "Operands": ["vip"], 
    "ComparisonValue": "$.Case.Fields.custom_case_field_id",
    "Negate": false
}
```

## Case template condition


**Parameters**
+ Operator - “CONTAINS\$1ANY”
+ Operands – A list of template ids.
+ ComparisonValue – "\$1.Case.TemplateId"
+ Negate - true/false

```
{
"Operator": "CONTAINS_ANY",
"Operands": ["templateId"],
"ComparisonValue": "$.Case.TemplateId",
"Negate": false
}
```

# OnSlaBreach


## Cases SLA name condition


**Parameters**
+ Operator - “CONTAINS\$1ANY”
+ Operands – A list of SLA names.
+ ComparisonValue – "\$1.RelatedItem.SlaConfiguration.Name"
+ Negate - false

```
{
"Operator": "CONTAINS_ANY",
"Operands": ["highPrioritySla"],
"ComparisonValue": "$.RelatedItem.SlaConfiguration.Name",
"Negate": false
}
```

# PatternMatch Operands


Each operand is an array of Pattern match objects.

## PatternMatch Object


**Type**
+ Description: The type of the pattern match object. 
+ Type: String
+ Valid values: `PLAIN` \$1 `LIST` \$1 `PROXIMITY` \$1 `NUMERICAL`
+ Required: Yes

**Value**
+ Description: Depending on the type, value type varies. 
  + If type is `PLAIN`, Value is a string. 
  + If type is `LIST`, Value is an array of `PLAIN` PatternMatch object. 
  + If type is `PROXIMITY`, Value is an object for format.

    ```
    {
      "Distance": number,
      "IsWithin": boolean
    }
    ```
  + If type is `NUMERICAL`, Value is an object for format. 

    ```
    {
      "Decimal": boolean
    }
    ```