> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thena.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get tickets analytics by standard fields

> MCP tool to get aggregated ticket analytics data grouped by multiple standard fields for a specific date range and team.

import Admonition from '@theme/Admonition';

### MCP tool: `get_tickets_analytics_by_standard_fields`

Get aggregated ticket analytics data grouped by multiple standard fields for a specific date range and team.

<Admonition type="note">
  This tool provides aggregated analytics data based on combinations of standard field values, not individual ticket details. Use the search\_tickets tool for finding specific tickets.
</Admonition>

### Example prompt

```prompt theme={null}
Get ticket analytics by assignee and status for the last month
```

<Admonition type="info">
  When you use this prompt in a chat with the model (with the MCP tool registered), the model will automatically call the <code>get\_tickets\_analytics\_by\_standard\_fields</code> tool with the correct arguments.
</Admonition>

### Parameters

<table>
  <thead>
    <tr>
      <th>Parameter</th>
      <th>Type</th>
      <th>Required</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr><td>dateRange</td><td>object</td><td>Yes</td><td>Inclusive date range to aggregate over</td></tr>
    <tr><td>dateRange.startDate</td><td>string</td><td>Yes</td><td>Start date in YYYY-MM-DD format</td></tr>
    <tr><td>dateRange.endDate</td><td>string</td><td>Yes</td><td>End date in YYYY-MM-DD format</td></tr>
    <tr><td>teamIds</td><td>string</td><td>No</td><td>Team ID to filter by (optional)</td></tr>
    <tr><td>selectedFields</td><td>string</td><td>Yes</td><td>Comma-separated list of standard fields to aggregate by (e.g., assignee,status,priority,sentiment)</td></tr>
    <tr><td>includeArchivedTickets</td><td>boolean</td><td>No</td><td>Include archived tickets (default: false)</td></tr>
    <tr><td>includeTicketMetadata</td><td>boolean</td><td>No</td><td>Include minimal ticket metadata for drill-down (default: false)</td></tr>
    <tr><td>metadataPage</td><td>number</td><td>No</td><td>Page number for metadata pagination (1-based, only used when includeTicketMetadata is true)</td></tr>
    <tr><td>metadataLimit</td><td>number</td><td>No</td><td>Limit for metadata results per page (max 500, only used when includeTicketMetadata is true)</td></tr>
  </tbody>
</table>

### Available standard fields

The following standard fields can be used in the `selectedFields` parameter:

* `assignee` - Ticket assignee
* `status` - Ticket status
* `priority` - Ticket priority
* `sentiment` - Ticket sentiment
* `type` - Ticket type
* `team` - Team information
* `account` - Account information

### Response fields

The response will contain aggregated analytics data with the following structure:

<table>
  <thead>
    <tr>
      <th>Field</th>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr><td>aggregationType</td><td>string</td><td>Type of aggregation performed ("multi\_field")</td></tr>
    <tr><td>totalTickets</td><td>number</td><td>Total number of tickets in the date range</td></tr>
    <tr><td>totalFound</td><td>number</td><td>Total number of tickets found matching criteria</td></tr>
    <tr><td>dateRange</td><td>object</td><td>The date range used for the analysis</td></tr>
    <tr><td>includeArchivedTickets</td><td>boolean</td><td>Whether archived tickets were included</td></tr>
    <tr><td>includeTicketMetadata</td><td>boolean</td><td>Whether ticket metadata was included</td></tr>
    <tr><td>aggregatedData</td><td>array</td><td>Array of team-based analytics objects with field aggregations</td></tr>
  </tbody>
</table>

#### Team analytics object fields

Each team in the `aggregatedData` array contains:

<table>
  <thead>
    <tr>
      <th>Field</th>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr><td>teamId</td><td>string</td><td>Team unique identifier</td></tr>
    <tr><td>teamName</td><td>string</td><td>Team name</td></tr>
    <tr><td>totalTickets</td><td>number</td><td>Total number of tickets for this team</td></tr>
    <tr><td>percentage</td><td>number</td><td>Percentage of total tickets</td></tr>
    <tr><td>fieldAggregations</td><td>object</td><td>Individual field aggregations with counts and percentages</td></tr>
    <tr><td>crossTabulation</td><td>object</td><td>Cross-tabulation analysis between selected fields</td></tr>
  </tbody>
</table>

#### Field aggregation fields

Each field in the `fieldAggregations` object contains an array of field values:

<table>
  <thead>
    <tr>
      <th>Field</th>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr><td>fieldName</td><td>string</td><td>Name of the field value (e.g., "Open", "John Doe")</td></tr>
    <tr><td>fieldUid</td><td>string</td><td>Unique identifier for the field value</td></tr>
    <tr><td>ticketCount</td><td>number</td><td>Number of tickets with this field value</td></tr>
    <tr><td>percentage</td><td>number</td><td>Percentage of total tickets</td></tr>
  </tbody>
</table>

#### Cross-tabulation fields

The `crossTabulation` object contains combinations of fields (e.g., "status\_assignee"):

<table>
  <thead>
    <tr>
      <th>Field</th>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr><td>primaryFieldName</td><td>string</td><td>Name of the primary field value</td></tr>
    <tr><td>primaryFieldUid</td><td>string</td><td>Unique identifier for the primary field value</td></tr>
    <tr><td>secondaryFieldBreakdown</td><td>object</td><td>Breakdown by secondary field with counts and percentages</td></tr>
  </tbody>
</table>

### Sample response

```json theme={null}
{
  "aggregationType": "multi_field",
  "totalTickets": 2,
  "totalFound": 2,
  "dateRange": {
    "startDate": "2025-01-01",
    "endDate": "2025-09-16"
  },
  "includeArchivedTickets": false,
  "includeTicketMetadata": false,
  "aggregatedData": [
    {
      "teamId": "THEVVHPCCER33E",
      "teamName": "Engineering",
      "totalTickets": 2,
      "percentage": 100,
      "fieldAggregations": {
        "status": [
          {
            "statusName": "Open",
            "statusUid": "3SC6BH2K10X5BSCXF2MFWVYZVYNFX",
            "ticketCount": 2,
            "percentage": 100
          }
        ],
        "assignee": [
          {
            "assigneeName": "John Doe",
            "assigneeUid": "UTHOOQNUUXZQQ3",
            "ticketCount": 2,
            "percentage": 100
          }
        ]
      },
      "crossTabulation": {
        "status_assignee": [
          {
            "statusName": "Open",
            "statusUid": "3SC6BH2K10X5BSCXF2MFWVYZVYNFX",
            "assigneeBreakdown": {
              "John Doe": {
                "ticketCount": 2,
                "percentage": 100,
                "assigneeId": "UTHOOQNUUXZQQ3"
              }
            }
          }
        ]
      }
    }
  ]
}
```

<Admonition type="tip">
  Always pass an object as input, even if empty, to avoid errors when calling the tool directly.
</Admonition>

<Admonition type="info">
  This tool is optimized for multi-dimensional analysis and cross-field correlation studies. You can combine multiple standard fields to get comprehensive insights.
</Admonition>

<Admonition type="warning">
  The date range must be valid and startDate must be less than or equal to endDate. Use ISO 8601 date format (YYYY-MM-DD). Field names in selectedFields must be valid standard field names.
</Admonition>

***
