ticket-resolution

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Read
bulk-operations/SKILL.md
first — JSONL piping, batch read, pagination, dry-run/digest/confirm, and
hubspot history
recovery live there.
hubspot <command> --help
is authoritative. Tickets use the
tickets
object type (plural, e.g.
tickets:45123
).
请先阅读
bulk-operations/SKILL.md
——其中包含JSONL管道传输、批量读取、分页、试运行/摘要/确认以及
hubspot history
恢复功能。
hubspot <command> --help
是权威参考文档。工单使用
tickets
对象类型(复数形式,例如
tickets:45123
)。

1. Discover pipeline + stages (portal-specific, run every session)

1. 发现管道与阶段(特定于门户,每次会话都需运行)

Stage IDs differ in every portal — never hard-code them.
bash
hubspot pipelines list --type tickets --format table
hubspot pipelines stages --type tickets --pipeline <pipeline_id> --format table
The stage table prints each stage's
ID
and
Label
("New", "Waiting on contact", "Closed", etc.).
每个门户中的阶段ID都不同——切勿硬编码这些ID。
bash
hubspot pipelines list --type tickets --format table
hubspot pipelines stages --type tickets --pipeline <pipeline_id> --format table
阶段表格会显示每个阶段的
ID
Label
(例如“新建”、“等待联系人回复”、“已关闭”等)。

2. Verify enum option values for THIS portal

2. 验证当前门户的枚举选项值

hs_ticket_priority
,
hs_ticket_category
, and
hs_resolution
are all
enumeration
properties — option values are portal-configurable and
hubspot properties get
does NOT return them. Discover by probing or by reading live records:
bash
undefined
hs_ticket_priority
hs_ticket_category
hs_resolution
均为
enumeration
属性——选项值可由门户配置,且
hubspot properties get
不会返回这些值。可通过探测或读取现有记录来获取:
bash
undefined

Probe: send an invalid value; the 400 error lists the allowed options.

探测:传入无效值;400错误会列出允许的选项。

hubspot objects update --type tickets <some_ticket_id> --property hs_resolution=probe
hubspot objects update --type tickets <some_ticket_id> --property hs_resolution=probe

error: "was not one of the allowed options: [ISSUE_FIXED, FEATURE_REQUEST_TRACKED, ...]"

错误信息:"不是允许的选项之一: [ISSUE_FIXED, FEATURE_REQUEST_TRACKED, ...]"

Or read values already in use:

或者读取已在使用的值:

hubspot objects list --type tickets --limit 10
--properties hs_ticket_priority,hs_ticket_category,hs_resolution

Do NOT assume HubSpot defaults — read the portal.
hubspot objects list --type tickets --limit 10
--properties hs_ticket_priority,hs_ticket_category,hs_resolution

请勿假设使用HubSpot默认值——请读取当前门户的配置。

3. Create a ticket and associate it

3. 创建工单并建立关联

subject
is the only practically-required property. Skipping
hs_pipeline
/
hs_pipeline_stage
lands the ticket in the default pipeline's first stage.
bash
hubspot objects create --type tickets \
  --property subject="Login error on mobile app" \
  --property content="User reports 401 since v3.2 release." \
  --property hs_pipeline=<pipeline_id> \
  --property hs_pipeline_stage=<new_stage_id> \
  --property hs_ticket_priority=<value_from_step_2> \
  --property hs_ticket_category=<value_from_step_2>
subject
是实际操作中唯一必填的属性。如果省略
hs_pipeline
/
hs_pipeline_stage
,工单将进入默认管道的第一个阶段。
bash
hubspot objects create --type tickets \
  --property subject="Login error on mobile app" \
  --property content="User reports 401 since v3.2 release." \
  --property hs_pipeline=<pipeline_id> \
  --property hs_pipeline_stage=<new_stage_id> \
  --property hs_ticket_priority=<value_from_step_2> \
  --property hs_ticket_category=<value_from_step_2>

Capture the "id" from the output JSON.

从输出的JSON中记录“id”。

hubspot associations create --from tickets:<ticket_id> --to contacts:<contact_id> hubspot associations create --from tickets:<ticket_id> --to companies:<company_id>

Bulk intake from a JSONL queue (see `bulk-operations/resources/json-patterns.md` for reshape patterns):

```bash
cat support_requests.jsonl \
| jq -c '{properties:{subject:.subject, content:.description,
    hs_pipeline:"<pipeline_id>", hs_pipeline_stage:"<new_stage_id>",
    hs_ticket_priority:"<priority>", hs_ticket_category:"<category>"}}' \
| hubspot objects create --type tickets
hubspot associations create --from tickets:<ticket_id> --to contacts:<contact_id> hubspot associations create --from tickets:<ticket_id> --to companies:<company_id>

从JSONL队列批量导入(如需重塑格式,请参考`bulk-operations/resources/json-patterns.md`):

```bash
cat support_requests.jsonl \
| jq -c '{properties:{subject:.subject, content:.description,
    hs_pipeline:"<pipeline_id>", hs_pipeline_stage:"<new_stage_id>",
    hs_ticket_priority:"<priority>", hs_ticket_category:"<category>"}}' \
| hubspot objects create --type tickets

4. Triage queries

4. 分类查询

bash
undefined
bash
undefined

Open tickets by priority

按优先级筛选未关闭工单

hubspot objects search --type tickets
--filter "hs_pipeline_stage=<open_stage_id> AND hs_ticket_priority=HIGH"
--properties subject,hubspot_owner_id,createdate
hubspot objects search --type tickets
--filter "hs_pipeline_stage=<open_stage_id> AND hs_ticket_priority=HIGH"
--properties subject,hubspot_owner_id,createdate

Unassigned

未分配的工单

hubspot objects search --type tickets
--filter "!hubspot_owner_id AND hs_pipeline_stage=<open_stage_id>"
--properties subject,hs_ticket_priority,createdate

Filter by owner with `hubspot_owner_id=<id>` (find IDs via `hubspot owners list --format table`).
hubspot objects search --type tickets
--filter "!hubspot_owner_id AND hs_pipeline_stage=<open_stage_id>"
--properties subject,hs_ticket_priority,createdate

使用`hubspot_owner_id=<id>`按负责人筛选(可通过`hubspot owners list --format table`获取ID)。

5. Advance tickets through stages (bulk update from search)

5. 推进工单阶段(从搜索结果批量更新)

bash
hubspot objects search --type tickets \
  --filter "hs_ticket_category=BILLING_ISSUE AND hs_pipeline_stage=<new_stage_id>" \
| jq -c '{id, properties:{hs_pipeline_stage:"<waiting_stage_id>"}}' \
| hubspot objects update --type tickets --dry-run
Re-pipe the same search without
--dry-run
to execute. For >100 rows, follow the
--digest/--confirm
flow in
bulk-operations/SKILL.md
("Safe destructive workflow"). Reassign in bulk works identically with
{hubspot_owner_id:"<new>"}
.
bash
hubspot objects search --type tickets \
  --filter "hs_ticket_category=BILLING_ISSUE AND hs_pipeline_stage=<new_stage_id>" \
| jq -c '{id, properties:{hs_pipeline_stage:"<waiting_stage_id>"}}' \
| hubspot objects update --type tickets --dry-run
移除
--dry-run
参数后重新执行相同的搜索管道即可完成操作。如果记录超过100条,请遵循
bulk-operations/SKILL.md
中的
--digest/--confirm
流程(“安全破坏性工作流”)。批量重新分配负责人的操作与此类似,只需使用
{hubspot_owner_id:"<new>"}
即可。

6. Log a resolution note

6. 记录结案备注

Activity creation lives in
sales-execution/SKILL.md
(notes/calls/meetings/tasks). After creating the note there, link it:
hubspot associations create --from notes:<note_id> --to tickets:<ticket_id>
.
活动创建功能位于
sales-execution/SKILL.md
中(包括备注、通话、会议、任务)。创建备注后,执行以下命令建立关联:
hubspot associations create --from notes:<note_id> --to tickets:<ticket_id>

7. Close the ticket

7. 关闭工单

hs_resolution
is an enumeration — pass an allowed option value from Step 2, not free text. HubSpot then computes
hs_is_closed=true
,
closed_date
, and
time_to_close
.
bash
hubspot objects update --type tickets <ticket_id> \
  --property hs_pipeline_stage=<closed_stage_id> \
  --property hs_resolution=<allowed_resolution_value>
hs_resolution
是一个枚举属性——请传入步骤2中获取的允许选项值,而非自由文本。HubSpot随后会自动计算
hs_is_closed=true
closed_date
time_to_close
bash
hubspot objects update --type tickets <ticket_id> \
  --property hs_pipeline_stage=<closed_stage_id> \
  --property hs_resolution=<allowed_resolution_value>

Known limitations

已知限制

  • properties get
    /
    list
    do not return enum options — probe via update error or read live records (CLI ask logged).
  • No Conversations/Inbox API surface — chat threads and inbox emails are not CLI-accessible.
  • properties get
    /
    list
    不会返回枚举选项——可通过更新错误探测或读取现有记录获取(已记录CLI需求)。
  • 无Conversations/Inbox API接口——聊天线程和收件箱邮件无法通过CLI访问。