> ## 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 status

> MCP tool to fetch ticket analytics grouped by status for a date range.

import Admonition from '@theme/Admonition';

### MCP tool: `get_tickets_analytics_by_status`

Fetch ticket analytics grouped by status for a date range.

<Admonition type="note">
  This tool provides aggregated analytics data grouped by ticket status, not individual ticket details. Use the search\_tickets tool for finding specific tickets.
</Admonition>

### Example prompt

```prompt theme={null}
Get ticket analytics by status for the last week
```

<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\_status</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>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</td></tr>
    <tr><td>teamIds</td><td>array</td><td>No</td><td>Optional array of team IDs to filter by</td></tr>
    <tr><td>metadataPage</td><td>number</td><td>No</td><td>Page number for metadata pagination</td></tr>
    <tr><td>metadataLimit</td><td>number</td><td>No</td><td>Limit for metadata results per page</td></tr>
  </tbody>
</table>

### 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 ("status")</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 status breakdowns</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>total</td><td>number</td><td>Total number of tickets for this team</td></tr>
    <tr><td>ticketCount</td><td>number</td><td>Number of tickets for this team (may be 0 for status aggregation)</td></tr>
    <tr><td>assignees</td><td>object</td><td>Assignee breakdown (empty for status aggregation)</td></tr>
    <tr><td>statusBreakdown</td><td>object</td><td>Status breakdown for this team's tickets</td></tr>
    <tr><td>assigneeBreakdown</td><td>object</td><td>Assignee breakdown for this team's tickets</td></tr>
    <tr><td>priorityBreakdown</td><td>object</td><td>Priority breakdown for this team's tickets</td></tr>
    <tr><td>sentimentBreakdown</td><td>object</td><td>Sentiment breakdown for this team's tickets</td></tr>
  </tbody>
</table>

#### Status/Assignee/Priority/Sentiment breakdown fields

Each status, assignee, priority, or sentiment in the breakdowns contains:

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

  <tbody>
    <tr><td>ticketCount</td><td>number</td><td>Number of tickets with this status/assignee/priority/sentiment</td></tr>
    <tr><td>percentage</td><td>number</td><td>Percentage of team tickets</td></tr>
    <tr><td>statusId/assigneeId/priorityId/sentimentId</td><td>string</td><td>Unique identifier for the status/assignee/priority/sentiment</td></tr>
  </tbody>
</table>

### Sample response

```json theme={null}
{
  "aggregationType": "status",
  "totalTickets": 2,
  "totalFound": 2,
  "dateRange": {
    "startDate": "2025-01-01",
    "endDate": "2025-09-16"
  },
  "includeArchivedTickets": false,
  "includeTicketMetadata": false,
  "aggregatedData": [
    {
      "teamId": "THEVVHPCCER33E",
      "teamName": "Engineering",
      "total": 2,
      "ticketCount": 0,
      "assignees": {},
      "statusBreakdown": {
        "Open": {
          "ticketCount": 2,
          "percentage": 100,
          "statusId": "3SC6BH2K10X5BSCXF2MFWVYZVYNFX"
        }
      },
      "assigneeBreakdown": {
        "John Doe": {
          "ticketCount": 2,
          "percentage": 100,
          "assigneeId": "UTHOOQNUUXZQQ3"
        }
      },
      "priorityBreakdown": {
        "Urgent": {
          "ticketCount": 1,
          "percentage": 50,
          "priorityId": "CSC6BH2K100SATQR0ZS6KHBW1DFPK"
        },
        "Medium": {
          "ticketCount": 1,
          "percentage": 50,
          "priorityId": "CSC6BH2K10XR2ZVVY84VV8506YN80"
        }
      },
      "sentimentBreakdown": {
        "Neutral": {
          "ticketCount": 1,
          "percentage": 50,
          "sentimentId": "MSC6BH2K1052GKT05M6QTFZVTPQ3S"
        },
        "Negative": {
          "ticketCount": 1,
          "percentage": 50,
          "sentimentId": "MSC6BH2K10CBVVTXD3Y6J5AC3X8R2"
        }
      }
    }
  ]
}
```

<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 workflow analysis and identifying bottlenecks in ticket processing. It provides comprehensive breakdowns by assignee, priority, and team for each status.
</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).
</Admonition>

***
