ticket-resolution について
ticket-resolution は、HubSpot CLI でサポートチケットを管理するスキルで、作成、振り分け、クローズを扱います。ポータル固有のパイプライン段階や選択肢を確認し、取り消せない更新は実行前にプレビューします。
主な機能
- 01ポータル固有のチケットパイプラインと段階の確認
- 02優先度、カテゴリ、解決方法の選択肢の取得
- 03チケットの作成とレコードの関連付け
- 04チケットの検索と一括ステージ更新
- 05解決メモの追加とチケットのクローズ
活用シーン
- 01優先度別に未完了チケットを抽出
- 02条件に合うチケットのステージを一括変更
- 03有効な解決方法を設定してチケットをクローズ
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ hubspot/ agent-cli-skills --skill ticket-resolutionインストール後、Claude Code で/ticket-resolutionを入力して読み込まれたか確認します。
詳細
まず bulk-operations/SKILL.md を読んでください — JSONL のパイピング、バッチ読み取り、ページネーション、dry-run/digest/confirm、そして hubspot history による復旧についての説明はそこにあります。hubspot <command> --help が正式な情報源です。チケットは tickets オブジェクトタイプを使用します(複数形、例: tickets:45123)。
1. パイプラインとステージを確認する(ポータル固有、セッションごとに実行)
ステージ ID はポータルごとに異なります — 絶対にハードコードしないでください。
hubspot pipelines list --type tickets --format table
hubspot pipelines stages --type tickets --pipeline <pipeline_id> --format table
ステージの表には、各ステージの ID と Label("New"、"Waiting on contact"、"Closed" など)が出力されます。pipelines list/get は各パイプラインの完全な stages 配列を jsonl/json で返すため、1 回の呼び出しで hs_pipeline_stage の値をそのラベルに対応付けるのに十分です。
2. このポータルでの enum オプション値を確認する
hs_ticket_priority、hs_ticket_category、hs_resolution はすべて enumeration プロパティです — オプション値はポータルごとに設定可能です。許可されているオプションは properties options-list で直接一覧表示できます(以前の objects update … --property hs_resolution=__probe__ によるプローブはもう機能しません — 更新は digest によるゲートで保護されるようになりました)。値とラベルをまとめて取得したい場合は、properties get が同じ options 配列をインラインで返します:
# List the allowed option values for each enum
hubspot properties options-list --type tickets hs_ticket_priority | jq -r '.value'
hubspot properties options-list --type tickets hs_ticket_category | jq -r '.value'
hubspot properties options-list --type tickets hs_resolution | jq -r '.value'
# each row: {"value":"ISSUE_FIXED","label":"Issue fixed","displayOrder":0,"hidden":false}
# Fallback — read values already in use on live records:
hubspot objects list --type tickets --limit 10 \
--properties hs_ticket_priority,hs_ticket_category,hs_resolution
HubSpot のデフォルト値を前提にしてはいけません — ポータルを読み取ってください。
3. チケットを作成して関連付ける
subject が実質的に唯一必須のプロパティです。hs_pipeline/hs_pipeline_stage を省略すると、チケットはデフォルトパイプラインの最初のステージに配置されます。
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.
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 を参照してください):
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. トリアージクエリ
# 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
# Unassigned
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> でオーナーによる絞り込みができます(ID は hubspot owners list --format table で確認できます)。
5. チケットをステージ間で進める(検索からの一括更新)
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
objects update は取り消しできないため、同じ検索を再パイプし、プレビュー行から --digest/--confirm を持ち越してください — これは >100 の場合だけでなく、どの行数でも必要です(confirm = バッチの行数)。--digest/--confirm の流れについては bulk-operations/SKILL.md の「安全な破壊的ワークフロー」を参照してください。一括での再割り当ても {hubspot_owner_id:"<new>"} で同様に機能します。
6. 解決メモを記録する
アクティビティの作成については sales-execution/SKILL.md(ノート/通話/会議/タスク)に記載されています。そこでノートを作成した後、リンクします: hubspot associations create --from notes:<note_id> --to tickets:<ticket_id>。
7. チケットをクローズする
hs_resolution は enumeration です — 自由記述ではなく、ステップ 2 で確認した許可済みのオプション値を渡してください。その後、HubSpot が hs_is_closed=true、closed_date、time_to_close を計算します。
objects update は取り消しできないため — まず dry-run を実行し、その後 digest と --confirm <ticket_id> を付けて再実行してください:
hubspot objects update --type tickets <ticket_id> \
--property hs_pipeline_stage=<closed_stage_id> \
--property hs_resolution=<allowed_resolution_value> --dry-run
hubspot objects update --type tickets <ticket_id> \
--property hs_pipeline_stage=<closed_stage_id> \
--property hs_resolution=<allowed_resolution_value> --digest <hash> --confirm <ticket_id>
既知の制限
- Enum オプション:
hubspot properties options-list --type tickets <property>で一覧表示できます(フォールバック: 実際のレコードを読み取る)。 - チャット/受信トレイ:
hubspot conversationsは受信トレイ、チャネル、スレッド、メッセージを読み取ります — 例えばhubspot conversations threads list --inbox-id <id> --associated-ticket-id <ticket_id>はチケットの背後にあるチャットスレッドを取得します。全機能についてはhubspot conversations --helpを実行してください。