Watch the age of open HubSpot Service Hub tickets

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

Runs
Weekdays at 9:00
Uses
HubSpot
Posts
Stat tile

From your apps to your board

How the skill works: your agent reads open stages from HubSpot, weekdays at 9:00, and gives you open over 3 days and the report in the chat.

Reads

  • HubSpotOpen stages
reads
Your agentClaude Code, Codex, Cursor or GeminiWeekdays at 9:00
posts

You get

  • Open over 3 daysA stat tile on your board, with its trend
  • The report in the chatEvery run, with or without Briefkin

What you get

  • 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.

The card on the right is a sample. Yours shows your own numbers and updates in place every run.

What lands on your board

AcmeOpen over 3 days14-18% vs previous period, bettervs last report
All open47
Over 7 days5
High or urgent, 3+ days5
An example with made-up numbers. Your agent posts your real ones.

What it does

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.

How it works

  1. 1Find the open stages

    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. 2Pull the open tickets

    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. 3

    3Bucket 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. 4

    4Name 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. 5

    5Post 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.

  6. Post it to the board

    With BRIEFKIN_TOKEN set, the agent sends the result as one card that updates in place every run. Without it, you get the report in the chat.

Install and run it

Pick your agent, where the data comes from and how to schedule it; the commands below follow.

Agent
Data
Schedule
  1. Install the skill

    One command. It puts the SKILL.md in ~/.claude/skills and in ~/.agents/skills, which Codex, Cursor, Gemini CLI, Copilot CLI and OpenCode read too.

    shellcurl -fsSL https://briefkin.dev/skills/hubspot-open-tickets-by-age/install | sh
  2. Run it

    Ask Claude Code:

    promptRun the hubspot-open-tickets-by-age skill

    Or paste the prompt instead of installing:

    promptFrom HubSpot Service Hub, get every open ticket (the stages whose ticketState is OPEN in my ticket pipelines). Bucket them by age since `createdate` (under 1 day, 1 to 3 days, 3 to 7 days, over 7 days) and by `hs_ticket_priority`, as a small grid with totals. Tell me how many are older than 3 days and how that compares with yesterday if you know. Then list the high and urgent tickets older than 3 days, oldest first, with ticket ID, subject, age and owner, and call out any open ticket that has no owner.
  3. Put it on a schedule

    Weekdays at 9:00, from cron on any machine where Claude Code is signed in:

    crontab0 9 * * 1-5 claude -p "Run the hubspot-open-tickets-by-age skill"

    Add it with crontab -e. A laptop asleep at that time runs it when it wakes if you use launchd or Task Scheduler instead; GitHub Actions works for the API route.

  4. Send it to your board

    Connect Briefkin once with curl -fsSL https://briefkin.dev/install | sh and every run lands on your board as a stat tile. How setup works

View the SKILL.mdRaw file
SKILL.md---
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

What your agent needs

  • 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.

Connecting HubSpot

  1. HubSpot MCP server, HubSpot's remote server at https://mcp.hubspot.com. HubSpot also offers a Claude connector built on the same server; you sign in with your HubSpot user and it sees what that user can see (docs).
  2. API with a private app token. Create a private app in your HubSpot account settings, give it only the scopes the report reads (crm.objects.deals.read, crm.objects.contacts.read, crm.objects.companies.read, crm.objects.owners.read), and store its token in HUBSPOT_ACCESS_TOKEN.

The MCP server and connector can create and update records, so for unattended reports a private app with only .read scopes is the safer credential.

Questions

Does time in Waiting on contact count toward age?

Yes, age runs from createdate. If you would rather not count tickets that are waiting on the customer, drop that stage ID from the search and the tile shows only tickets where the team owes the next reply.

We have several ticket pipelines. Which one does it read?

All of them, since the open stage IDs come from every pipeline. To report on one, add hs_pipeline EQ <pipeline id> to the search and use a separate item_key per pipeline so each gets its own tile.

Do I need Briefkin to use the HubSpot open tickets by age skill?

No. The skill runs with your own agent and gives you the report in the chat. With a Briefkin token set, each run also posts it to your board as a stat tile, so you can glance at it instead of asking again.

Which agents can run it?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot CLI, OpenCode, Windsurf and Amp all read SKILL.md files. The install command puts it in ~/.claude/skills and ~/.agents/skills, where they look. ChatGPT, the Claude app and Grok take the prompt instead. Pick your agent under "Install and run it" and the commands change to match.

Can it work without an API or MCP server, from my browser?

Yes. Switch the data source to "Your browser" and the steps change to the HubSpot pages themselves: the agent opens app.hubspot.com/contacts in a browser you are signed in to and reads the numbers off the page. Claude Code, Codex, Cursor, Claude app and ChatGPT can drive a browser out of the box; Gemini CLI, Copilot CLI and OpenCode need a Playwright or Chrome DevTools MCP server first. It is slower than the API and needs you signed in, so it suits a report you run by hand or from a scheduler on your own computer.

Watch open over 3 days on your board, run after run

Skills are free to use with any agent. Briefkin is where their results land: one board for every report, number and question your agents send, with a ping when something needs you.

Free during the open beta. No card.