問題分類(Linear / Jira)
透過 Composio CLI 在 Linear 或 Jira 上驅動分類會議與錯誤清理。擷取積壓工作、將重複問題分群、套用標籤,然後將乾淨的清單交給團隊。
使用時機
- 每週分類:「哪些是未指派、過期或缺少優先級?」
- 版本發布後進行錯誤清理:「將所有 P1/P2 錯誤分群、去重、指派負責人。」
- 跨工具同步:Sentry → Linear、PagerDuty → Jira。
前置需求
curl -fsSL https://composio.dev/install | bash
composio login
composio link linear # 或:composio link jira
探索工具
composio search "list issues" --toolkits linear
composio search "search issues" --toolkits jira
composio tools list linear
composio tools list jira
常用 slug(請用 --get-schema 驗證):
Linear
LINEAR_LIST_ISSUESLINEAR_CREATE_ISSUELINEAR_UPDATE_ISSUELINEAR_CREATE_COMMENT
Jira
JIRA_SEARCH_FOR_ISSUES_USING_JQLJIRA_CREATE_ISSUEJIRA_EDIT_ISSUEJIRA_ADD_COMMENTJIRA_ASSIGN_ISSUE
分類工作流程
- 擷取積壓工作片段:
# Linear composio execute LINEAR_LIST_ISSUES -d '{ "filter": { "state": { "type": { "eq": "unstarted" } }, "assignee": { "null": true } }, "first": 100 }' # Jira composio execute JIRA_SEARCH_FOR_ISSUES_USING_JQL -d '{ "jql": "project = APP AND statusCategory != Done AND assignee is EMPTY ORDER BY updated DESC", "maxResults": 100, "fields": ["summary","priority","labels","updated","reporter"] }' - 分群:根據標題相似度和標籤進行分群。代理程式會在本地端將可能的重複問題分組。
- 一次套用更新(標籤、優先級、指派者):
composio execute LINEAR_UPDATE_ISSUE -d '{ "id":"abc-123","priority":2,"labelIds":["label-bug","label-p1"],"assigneeId":"user-42" }' composio execute JIRA_EDIT_ISSUE -d '{ "issueIdOrKey":"APP-482", "fields":{"priority":{"name":"High"},"labels":["bug","p1"]} }' - 連結重複問題:透過引用正規問題的註解來連結重複項目。
- 發布變更摘要到 Slack,讓團隊看到清理結果。
錯誤清理(版本發布後)
# Jira:過去 7 天內提交的所有錯誤,按嚴重程度排序
composio execute JIRA_SEARCH_FOR_ISSUES_USING_JQL -d '{
"jql":"type = Bug AND created >= -7d ORDER BY priority DESC, created ASC",
"fields":["summary","priority","labels","reporter","components"]
}' | jq -r '.issues[] | "\(.fields.priority.name)\t\(.key)\t\(.fields.summary)"'
工作流程檔案
scripts/triage-linear.ts,使用 composio run --file scripts/triage-linear.ts 執行:
const { nodes: issues } = await execute("LINEAR_LIST_ISSUES", {
filter: { state: { type: { eq: "unstarted" } }, assignee: { null: true } },
first: 100
});
const stale = issues.filter(i => {
const age = (Date.now() - new Date(i.updatedAt).getTime()) / 86400000;
return age > 14;
});
for (const i of stale) {
await execute("LINEAR_CREATE_COMMENT", {
issueId: i.id,
body: "自動分類:已過期 14 天以上。請指派或關閉。"
});
}
await execute("SLACK_SEND_MESSAGE", {
channel: "triage",
text: `每週分類:已提醒 ${stale.length} 個過期問題。`
});
跨工具:Sentry → Linear
composio run '
const hot = await execute("SENTRY_LIST_A_PROJECTS_ISSUES", {
organization_slug:"acme", project_slug:"api",
query:"is:unresolved", sort:"freq", limit:5
});
for (const s of hot) {
await execute("LINEAR_CREATE_ISSUE", {
teamId: "TEAM_ID",
title: `[Sentry] ${s.title}`,
description: `${s.permalink}\n次數: ${s.count}`,
labelIds: ["label-bug","label-from-sentry"]
});
}
'
疑難排解
- 未知的欄位名稱 → 使用
composio execute <SLUG> --get-schema查看確切的篩選結構(Linear 使用巢狀物件;Jira 使用 JQL 字串)。 - Linear 回傳
403→ 使用正確的工作區重新執行composio link linear。 - Jira 自訂欄位遺失 → 在
fields陣列中明確要求它們。 - 批次編輯觸發速率限制 → 在
composio run迴圈中插入 250ms 的延遲;不要使用--parallel。
完整的 CLI 參考文件:docs.composio.dev/docs/cli