sales-execution
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseResources
资源
| File | When to use |
|---|---|
| Property names and enum values for calls/notes/meetings/tasks. Keep open while writing |
Read first — this skill assumes its batching, pipe, and dry-run patterns.
bulk-operations/SKILL.md| 文件 | 使用场景 |
|---|---|
| 通话/笔记/会议/任务的属性名称和枚举值。在编写 |
请先阅读——本技能默认你已了解其中的批量处理、管道和试运行模式。
bulk-operations/SKILL.mdThe two non-obvious rules
两个容易忽略的规则
1. Activities are invisible until associated. alone produces a record nobody can see in the CRM UI. Always follow with (and the deal, if relevant) before stopping.
hubspot objects create --type calls ...hubspot associations create --from calls:<id> --to contacts:<id>2. Timestamps differ between write and read.
| Path | Field | Format |
|---|---|---|
| | Unix ms (13 digits) |
| | Unix ms (string) |
| | ISO 8601 (e.g. |
Current Unix ms: (macOS) or (Linux). rows are — the cross-type timeline read shape, no raw property names.
$(date +%s)000$(date +%s%3N)activities list{"id","type","timestamp","title","body","status","owner_id"}1. 活动关联后才可见。仅执行会生成一条在CRM界面中无人可见的记录。在操作结束前,务必接着执行(如果涉及交易,也要关联交易)。
hubspot objects create --type calls ...hubspot associations create --from calls:<id> --to contacts:<id>2. 写入和读取的时间戳格式不同
| 路径 | 字段 | 格式 |
|---|---|---|
| | Unix毫秒(13位数字) |
| | Unix毫秒(字符串格式) |
| | ISO 8601(例如: |
当前Unix毫秒时间:(macOS)或(Linux)。返回的行格式为——这是跨类型时间线读取的统一格式,不包含原始属性名称。
$(date +%s)000$(date +%s%3N)activities list{"id","type","timestamp","title","body","status","owner_id"}Create + associate, by type
按类型执行创建+关联操作
bash
undefinedbash
undefinedCALL
通话
call_id=$(hubspot objects create --type calls
--property hs_call_title="Discovery call"
--property hs_call_body="Confirmed $50K budget, Q2 timeline."
--property hs_call_direction=OUTBOUND
--property hs_call_status=COMPLETED
--property hs_call_duration=1800000
--property hs_timestamp=$(date +%s)000
--format json | jq -r '.id') hubspot associations create --from calls:$call_id --to contacts:149 hubspot associations create --from calls:$call_id --to deals:456
--property hs_call_title="Discovery call"
--property hs_call_body="Confirmed $50K budget, Q2 timeline."
--property hs_call_direction=OUTBOUND
--property hs_call_status=COMPLETED
--property hs_call_duration=1800000
--property hs_timestamp=$(date +%s)000
--format json | jq -r '.id') hubspot associations create --from calls:$call_id --to contacts:149 hubspot associations create --from calls:$call_id --to deals:456
call_id=$(hubspot objects create --type calls
--property hs_call_title="Discovery call"
--property hs_call_body="Confirmed $50K budget, Q2 timeline."
--property hs_call_direction=OUTBOUND
--property hs_call_status=COMPLETED
--property hs_call_duration=1800000
--property hs_timestamp=$(date +%s)000
--format json | jq -r '.id') hubspot associations create --from calls:$call_id --to contacts:149 hubspot associations create --from calls:$call_id --to deals:456
--property hs_call_title="Discovery call"
--property hs_call_body="Confirmed $50K budget, Q2 timeline."
--property hs_call_direction=OUTBOUND
--property hs_call_status=COMPLETED
--property hs_call_duration=1800000
--property hs_timestamp=$(date +%s)000
--format json | jq -r '.id') hubspot associations create --from calls:$call_id --to contacts:149 hubspot associations create --from calls:$call_id --to deals:456
NOTE
笔记
note_id=$(hubspot objects create --type notes
--property hs_note_body="Sent proposal. Follow-up Friday."
--property hs_timestamp=$(date +%s)000
--format json | jq -r '.id') hubspot associations create --from notes:$note_id --to deals:456
--property hs_note_body="Sent proposal. Follow-up Friday."
--property hs_timestamp=$(date +%s)000
--format json | jq -r '.id') hubspot associations create --from notes:$note_id --to deals:456
note_id=$(hubspot objects create --type notes
--property hs_note_body="Sent proposal. Follow-up Friday."
--property hs_timestamp=$(date +%s)000
--format json | jq -r '.id') hubspot associations create --from notes:$note_id --to deals:456
--property hs_note_body="Sent proposal. Follow-up Friday."
--property hs_timestamp=$(date +%s)000
--format json | jq -r '.id') hubspot associations create --from notes:$note_id --to deals:456
MEETING — start/end in Unix ms; reuse start as hs_timestamp
会议 — 开始/结束时间为Unix毫秒;将开始时间复用为hs_timestamp
start=$(date +%s)000; end=$(( ${start%000} + 3600 ))000
meeting_id=$(hubspot objects create --type meetings
--property hs_meeting_title="Demo — Acme" --property hs_meeting_outcome=COMPLETED
--property hs_meeting_start_time=$start --property hs_meeting_end_time=$end
--property hs_timestamp=$start --format json | jq -r '.id') hubspot associations create --from meetings:$meeting_id --to contacts:149
--property hs_meeting_title="Demo — Acme" --property hs_meeting_outcome=COMPLETED
--property hs_meeting_start_time=$start --property hs_meeting_end_time=$end
--property hs_timestamp=$start --format json | jq -r '.id') hubspot associations create --from meetings:$meeting_id --to contacts:149
start=$(date +%s)000; end=$(( ${start%000} + 3600 ))000
meeting_id=$(hubspot objects create --type meetings
--property hs_meeting_title="Demo — Acme" --property hs_meeting_outcome=COMPLETED
--property hs_meeting_start_time=$start --property hs_meeting_end_time=$end
--property hs_timestamp=$start --format json | jq -r '.id') hubspot associations create --from meetings:$meeting_id --to contacts:149
--property hs_meeting_title="Demo — Acme" --property hs_meeting_outcome=COMPLETED
--property hs_meeting_start_time=$start --property hs_meeting_end_time=$end
--property hs_timestamp=$start --format json | jq -r '.id') hubspot associations create --from meetings:$meeting_id --to contacts:149
TASK — hs_timestamp is the DUE DATE, not creation time
任务 — hs_timestamp为截止日期,而非创建时间
due=$(( $(date -v+7d +%s) * 1000 )) # macOS; Linux: date -d '7 days' +%s
task_id=$(hubspot objects create --type tasks
--property hs_task_subject="Confirm proposal received"
--property hs_task_priority=HIGH
--property hs_task_status=NOT_STARTED
--property hs_task_type=CALL
--property hs_timestamp=$due
--format json | jq -r '.id') hubspot associations create --from tasks:$task_id --to deals:456
--property hs_task_subject="Confirm proposal received"
--property hs_task_priority=HIGH
--property hs_task_status=NOT_STARTED
--property hs_task_type=CALL
--property hs_timestamp=$due
--format json | jq -r '.id') hubspot associations create --from tasks:$task_id --to deals:456
undefineddue=$(( $(date -v+7d +%s) * 1000 )) # macOS系统;Linux系统:date -d '7 days' +%s
task_id=$(hubspot objects create --type tasks
--property hs_task_subject="Confirm proposal received"
--property hs_task_priority=HIGH
--property hs_task_status=NOT_STARTED
--property hs_task_type=CALL
--property hs_timestamp=$due
--format json | jq -r '.id') hubspot associations create --from tasks:$task_id --to deals:456
--property hs_task_subject="Confirm proposal received"
--property hs_task_priority=HIGH
--property hs_task_status=NOT_STARTED
--property hs_task_type=CALL
--property hs_timestamp=$due
--format json | jq -r '.id') hubspot associations create --from tasks:$task_id --to deals:456
undefinedOpen tasks for a contact — two CLI calls, no xargs
查询联系人的未完成任务——两次CLI调用,无需xargs
associations list{"id","type"}objects getbulk-operations/SKILL.mdbash
hubspot associations list --from contacts:149 --to tasks \
| hubspot objects get --type tasks \
--properties hs_task_subject,hs_task_status,hs_task_priority,hs_timestamp \
| jq -c 'select(.properties.hs_task_status != "COMPLETED")'associations list{"id","type"}objects getbulk-operations/SKILL.mdbash
hubspot associations list --from contacts:149 --to tasks \
| hubspot objects get --type tasks \
--properties hs_task_subject,hs_task_status,hs_task_priority,hs_timestamp \
| jq -c 'select(.properties.hs_task_status != "COMPLETED")'Bulk: follow-up task per deal in a stage
批量操作:为某一阶段的每个交易创建跟进任务
The deal ID and the task ID must travel together. Persist the deal payload to a file, create tasks (output order matches input order — see bulk-operations), then zip the two ID lists line-by-line and stream association pairs in one call.
bash
due=$(( $(date -v+7d +%s) * 1000 ))交易ID和任务ID必须一一对应。将交易负载保存到文件中,创建任务(输出顺序与输入顺序一致——详见批量操作文档),然后将两个ID列表逐行配对,并通过一次调用批量提交关联对。
bash
due=$(( $(date -v+7d +%s) * 1000 ))1. Per-deal payload, deal_id retained alongside the create payload.
1. 每个交易的负载,保留deal_id与创建负载一起。
hubspot objects search --type deals --filter "dealstage=appointmentscheduled"
--properties dealname
| jq -c --argjson due "$due" '{deal_id: .id, payload: {properties: { hs_task_subject: ("Follow up: " + .properties.dealname), hs_task_priority: "HIGH", hs_task_status: "NOT_STARTED", hs_task_type: "CALL", hs_timestamp: ($due|tostring) }}}' > /tmp/deal_tasks.jsonl
--properties dealname
| jq -c --argjson due "$due" '{deal_id: .id, payload: {properties: { hs_task_subject: ("Follow up: " + .properties.dealname), hs_task_priority: "HIGH", hs_task_status: "NOT_STARTED", hs_task_type: "CALL", hs_timestamp: ($due|tostring) }}}' > /tmp/deal_tasks.jsonl
hubspot objects search --type deals --filter "dealstage=appointmentscheduled"
--properties dealname
| jq -c --argjson due "$due" '{deal_id: .id, payload: {properties: { hs_task_subject: ("Follow up: " + .properties.dealname), hs_task_priority: "HIGH", hs_task_status: "NOT_STARTED", hs_task_type: "CALL", hs_timestamp: ($due|tostring) }}}' > /tmp/deal_tasks.jsonl
--properties dealname
| jq -c --argjson due "$due" '{deal_id: .id, payload: {properties: { hs_task_subject: ("Follow up: " + .properties.dealname), hs_task_priority: "HIGH", hs_task_status: "NOT_STARTED", hs_task_type: "CALL", hs_timestamp: ($due|tostring) }}}' > /tmp/deal_tasks.jsonl
2. Create tasks; one CLI call for the whole batch.
2. 创建任务;一次CLI调用完成整个批量操作。
jq -c '.payload' /tmp/deal_tasks.jsonl
| hubspot objects create --type tasks > /tmp/created_tasks.jsonl
| hubspot objects create --type tasks > /tmp/created_tasks.jsonl
jq -c '.payload' /tmp/deal_tasks.jsonl
| hubspot objects create --type tasks > /tmp/created_tasks.jsonl
| hubspot objects create --type tasks > /tmp/created_tasks.jsonl
3. Zip and stream association pairs through stdin.
3. 配对并通过标准输入流式传输关联对。
paste
<(jq -r '.deal_id' /tmp/deal_tasks.jsonl)
<(jq -r '.id' /tmp/created_tasks.jsonl)
| jq -Rc 'split("\t") | {from:("tasks:"+.[1]), to:("deals:"+.[0])}'
| hubspot associations create
<(jq -r '.deal_id' /tmp/deal_tasks.jsonl)
<(jq -r '.id' /tmp/created_tasks.jsonl)
| jq -Rc 'split("\t") | {from:("tasks:"+.[1]), to:("deals:"+.[0])}'
| hubspot associations create
For >100 rows, apply the dry-run / digest / confirm pattern from `bulk-operations/SKILL.md`.paste
<(jq -r '.deal_id' /tmp/deal_tasks.jsonl)
<(jq -r '.id' /tmp/created_tasks.jsonl)
| jq -Rc 'split("\t") | {from:("tasks:"+.[1]), to:("deals:"+.[0])}'
| hubspot associations create
<(jq -r '.deal_id' /tmp/deal_tasks.jsonl)
<(jq -r '.id' /tmp/created_tasks.jsonl)
| jq -Rc 'split("\t") | {from:("tasks:"+.[1]), to:("deals:"+.[0])}'
| hubspot associations create
如果行数超过100,请应用`bulk-operations/SKILL.md`中的试运行/摘要/确认模式。Known constraints
已知限制
Activities must be associated immediately or they're invisible in the CRM UI. doesn't return enum option values for activity types — use the reference. No sequences/cadences in the CLI.
properties get活动必须立即关联,否则在CRM界面中不可见。不会返回活动类型的枚举选项值——请使用参考文档。CLI不支持序列/节奏功能。
properties get