Linear Ticket Enrichment

On-demand enrichment of Linear sales tickets with HubSpot context (deal, contacts, company).

Overview

When working on a sales ticket in Cursor, you can enrich it with HubSpot context to see:

  • Deal information (name, stage, amount, close date)
  • Associated contacts (names, emails, roles)
  • Associated company (name, domain, industry)
  • Recent updates and notes

Usage

Enrich Ticket with HubSpot Context

import { fetchHubSpotContext } from './enrich-ticket.js';
import { formatHubSpotContext } from './format-context.js';
 
// Search by company name
const context = await fetchHubSpotContext({
  companyName: 'Inteleos Foundation'
});
 
// Format for Linear ticket
const markdown = formatHubSpotContext(context);
// Add to Linear ticket description or comment

Infer Deal from Ticket

Automatically find matching HubSpot deal from ticket title/description:

import { inferDealFromTicket } from './enrich-ticket.js';
 
const context = await inferDealFromTicket(
  'Inteleos Foundation - Interim Data Leadership',
  'Client: Inteleos Foundation\nContact: Juan Sanchez',
  'SAL-649'
);

Store the Linear ticket reference on the HubSpot deal:

import { linkTicketToDeal } from './link-ticket.js';
 
await linkTicketToDeal(
  'deal-id-123',
  'SAL-649',
  'https://linear.app/brainforge/issue/SAL-649/...'
);

Enrichment Format

The enrichment adds a formatted section to the Linear ticket:

## HubSpot Context
 
**Deal**: Inteleos Foundation - Data Leadership ($15K/mo)
**Stage**: Qualified To Buy
**Pipeline**: Sales Pipeline
**Close Date**: 3/1/2026
**SOW Status**: Draft
**Engagement Phase**: Phase 1
 
**Contacts**:
- Juan Sanchez (CDO) - juan@inteleos.org
 
**Company**:
Inteleos Foundation (inteleos.org) - Nonprofit, 140 employees
 
[View Deal in HubSpot](https://app.hubspot.com/deals/123)
 
*Last updated: 1/31/2026, 5:40 PM*

Auto-Suggest Flow

When opening a sales ticket in Cursor:

  1. Extract ticket title and description
  2. Attempt to infer matching HubSpot deal
  3. If found, suggest enrichment: “Would you like to enrich this ticket with HubSpot context?”
  4. If confirmed, fetch full context and add to ticket

Pipeline Inference

When creating or updating deals, the system can infer the pipeline:

  • Sales Pipeline: Default for sales tickets
  • Custom Pipelines: Based on deal properties, labels, or ticket context
  • User Prompt: If inference is uncertain, ask user: “Which pipeline should this deal go in?”

Integration with Cursor

The enrichment can be triggered via natural language in Cursor:

  • “Enrich this ticket with HubSpot context”
  • “Link this ticket to HubSpot deal X”
  • “Show me the HubSpot context for this lead”
  • “What’s the status of the Inteleos deal?”