---
name: hubspot-open-tickets-by-age
description: "Every weekday: open Service Hub tickets by age and priority, the oldest high-priority ones by name, and whether the old pile shrank. Use when the user asks for this, or when it runs on a schedule."
---

# HubSpot open tickets by age

Every weekday: open Service Hub tickets by age and priority, the oldest high-priority ones by name, and whether the old pile shrank.

Support teams on HubSpot Service Hub can see how many tickets are open; it is harder to see how old they are. A queue of 40 that turns over daily is healthy. A queue of 40 where a dozen have been open since last month is not, and the ticket board looks the same in both cases.

Every weekday before stand-up, the agent sorts the open tickets into age buckets and crosses them with priority. The number on the tile is tickets open longer than 3 days, so it goes down when the team catches up on old work, not just new work.

## Two ways to get the data

Use the API or MCP route when you have an MCP server, a CLI or an API token for the app. Otherwise, if you can drive a browser the user is signed in to (Claude in Chrome, a Playwright or Chrome DevTools MCP server), use the browser route. Say which one you used.

## Route A: API or MCP server

### What you need

- Service Hub ticket access: a private app token with the `tickets` and `crm.objects.owners.read` scopes in `HUBSPOT_ACCESS_TOKEN`, or a HubSpot connector.

If something is missing, say what and stop; do not invent numbers.

### Steps

1. **Find the open stages** (HubSpot): Call `GET /crm/v3/pipelines/tickets` and keep every stage whose `metadata.ticketState` is `OPEN`. In the default pipeline these are New, Waiting on contact and Waiting on us.
2. **Pull the open tickets** (HubSpot): `POST /crm/v3/objects/tickets/search` with `hs_pipeline_stage IN` those stage IDs and properties `subject`, `hs_ticket_priority`, `hs_pipeline`, `hs_pipeline_stage`, `createdate` and `hubspot_owner_id`, paging with `after`. Search stops at 10,000 results, which is plenty for an open queue.
3. **Bucket by age and priority**: Age is now minus `createdate`. Use the buckets under 1 day, 1 to 3 days, 3 to 7 days and over 7 days, crossed with `hs_ticket_priority` (`URGENT`, `HIGH`, `MEDIUM`, `LOW`).
4. **Name the worst ones**: List up to 8 `HIGH` or `URGENT` tickets older than 3 days, oldest first, with owner and subject, and call out any open ticket with no `hubspot_owner_id`.
5. **Post the tile**: The headline is open tickets older than 3 days, compared with yesterday's run. Add total open, the over-7-days count and the age by priority grid.

## Route B: the browser

### What you need

- Signed in to HubSpot with a Service Hub seat that can view all tickets in the pipelines you report on.

If something is missing, say what and stop; do not invent numbers.

### Steps

Start at https://app.hubspot.com/contacts/. The user is signed in already; never type passwords or codes, and ask if a sign-in page appears.

1. **Open the tickets index**: Pick the account, then go to **CRM > Tickets** and use the list view (the **Help Desk** workspace under Service shows the same tickets, but the index table is easier to filter and sort). Filter **Ticket status** to the open stages of every pipeline you care about: in the default pipeline New, Waiting on contact and Waiting on us.
2. **Show age and priority**: With **Edit columns**, show Ticket name, **Priority**, Pipeline, Ticket status, **Create date** and Ticket owner, and sort by Create date, oldest first. The count above the table is total open.
3. **Count the age buckets**: Add a **Create date** is **before** filter and set it to 1, 3 and 7 days ago in turn, reading the count each time; repeat with **Priority** is Urgent, High, Medium and Low to fill the grid. Older than 3 days is the headline; compare it with the number you saved yesterday.
4. **Name the worst and the unowned**: Filter Priority is any of High and Urgent with Create date before 3 days ago, oldest first, and note up to 8 with owner and subject. Then clear priority and add **Ticket owner** is unknown for the tickets nobody holds.

Note: Create date is when the ticket was opened, so time in Waiting on contact counts, exactly as in the API route; drop that stage from the status filter to measure only tickets where the team owes the next reply. The index page keeps no history, so yesterday's comparison needs the number you wrote down.

## The report

- **Open over 3 days** (the tile) and the change since yesterday.
- **Age by priority**: open tickets in each age bucket and priority, with totals.
- **Oldest high and urgent tickets**, with owner and subject.
- Open tickets with no owner, called out on their own.

## Post it to Briefkin

When `BRIEFKIN_TOKEN` is set, or `~/.config/briefkin/env` exists (the installer from https://briefkin.dev/docs writes it), also send the result to the user's Briefkin board as one card. Keep the `item_key` the same on every run so the card updates in place, use a new `event_id` per run, and put today's real numbers in place of the example ones. If the request fails, say so once and carry on.

```bash
[ -n "${BRIEFKIN_TOKEN:-}" ] || . ~/.config/briefkin/env
curl -sS -X POST "${BRIEFKIN_URL:-https://briefkin.dev}/v1/events" \
  -H "authorization: Bearer $BRIEFKIN_TOKEN" \
  -H "content-type: application/json" \
  -d @- <<'JSON'
{
  "v": 1,
  "event_id": "hubspot-open-tickets-by-age/<date of this run, e.g. 2026-10-16>",
  "item_key": "hubspot-open-tickets-by-age",
  "project": "Acme",
  "source": "HubSpot open tickets by age skill",
  "kind": "metric",
  "title": "14 tickets open for more than 3 days",
  "metric": {
    "label": "Open over 3 days",
    "value": 14,
    "better": "lower",
    "period_start": "<start of the period, ISO 8601>",
    "period_end": "<end of the period, ISO 8601>"
  },
  "glance": {
    "type": "Grid",
    "props": {
      "columns": 3
    },
    "children": [
      {
        "type": "Stat",
        "props": {
          "label": "All open",
          "value": 47
        }
      },
      {
        "type": "Stat",
        "props": {
          "label": "Over 7 days",
          "value": 5,
          "tone": "warn"
        }
      },
      {
        "type": "Stat",
        "props": {
          "label": "High or urgent, 3+ days",
          "value": 5,
          "tone": "bad"
        }
      }
    ]
  },
  "widget": [
    {
      "type": "Table",
      "props": {
        "columns": [
          "Age",
          "Urgent",
          "High",
          "Medium",
          "Low",
          "Total"
        ],
        "align": [
          "left",
          "right",
          "right",
          "right",
          "right",
          "right"
        ],
        "rows": [
          [
            "Under 1 day",
            1,
            4,
            9,
            4,
            18
          ],
          [
            "1 to 3 days",
            0,
            3,
            8,
            4,
            15
          ],
          [
            "3 to 7 days",
            1,
            2,
            4,
            2,
            9
          ],
          [
            "Over 7 days",
            0,
            2,
            1,
            2,
            5
          ]
        ]
      }
    },
    {
      "type": "Table",
      "props": {
        "columns": [
          "Ticket",
          "Priority",
          "Age",
          "Owner"
        ],
        "align": [
          "left",
          "left",
          "right",
          "left"
        ],
        "rows": [
          [
            "#4817 SSO login loops after password reset",
            "High",
            "11 days",
            "Aisha"
          ],
          [
            "#4852 Invoice PDF shows the wrong VAT rate",
            "High",
            "8 days",
            "No owner"
          ],
          [
            "#4903 API returns 502 on bulk export",
            "Urgent",
            "4 days",
            "Jonas"
          ],
          [
            "#4911 Deactivated user cannot be removed",
            "High",
            "4 days",
            "Aisha"
          ],
          [
            "#4920 Webhook retries stopped",
            "High",
            "3 days",
            "Marco"
          ]
        ]
      }
    },
    {
      "type": "Callout",
      "props": {
        "text": "#4852 has been open 8 days and nobody owns it.",
        "tone": "bad"
      }
    }
  ],
  "size": "md"
}
JSON
```

Widgets come from the Briefkin catalog (https://briefkin.dev/v1/catalog). Without a token, just give the user the report.

Set `period_start` and `period_end` to the window the number covers: the tile names it from them ("Last 7 days", "Today", "This month"). For a count right now (open items, a balance), send `"period_label": ""` so no period shows; for another name, send it as `period_label` (at most 24 characters).

## Run it on a schedule

Suggested: Weekdays at 9:00 (`0 9 * * 1-5`). From cron, with the agent signed in on that machine:

```bash
0 9 * * 1-5 claude -p "Run the hubspot-open-tickets-by-age skill"
# Codex: codex exec, Gemini CLI: gemini -p, Copilot CLI: copilot -p, OpenCode: opencode run
```

Or use the agent's own scheduler (Claude Code routines, Codex automations, Claude or ChatGPT scheduled tasks): https://briefkin.dev/skills/hubspot-open-tickets-by-age#schedule

Source: https://briefkin.dev/skills/hubspot-open-tickets-by-age
