> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 批量规划工单待办

export const UseCaseHero = ({title, description, prompt, category, features, devinUrl, agent, intent, playbookId, type}) => {
  const encodedPrompt = encodeURIComponent(prompt || '');
  const tag = 'docs-use-case-gallery';
  const utm = 'utm_source=docs&utm_medium=use-case-gallery&utm_campaign=hero-cta';
  const agentParams = (agent ? '&agent=' + agent : '') + (intent ? '&intent=' + intent : '') + (playbookId ? '&playbookId=' + playbookId : '');
  const devinHref = type === 'schedule' ? 'https://app.devin.ai/settings/schedules/create?' + utm + agentParams + (prompt ? '&prompt=' + encodedPrompt : '') : type === 'review' ? 'https://app.devin.ai/review?' + utm : agent === 'ada' ? 'https://app.devin.ai/search?' + utm + '&noSubmit=true' + (prompt ? '&prompt=' + encodedPrompt : '') : devinUrl ? devinUrl.includes('?') ? devinUrl + '&' + utm + agentParams : devinUrl + '?' + utm + agentParams : prompt ? 'https://app.devin.ai/?tags=' + tag + '&' + utm + agentParams + '&prompt=' + encodedPrompt : 'https://app.devin.ai/?' + utm + agentParams;
  const buttonLabel = type === 'schedule' ? 'Schedule in Devin ↗' : type === 'review' ? 'Set Up Devin Review ↗' : agent === 'advanced' ? 'Try in Devin ↗' : agent === 'dana' ? 'Try in Dana ↗' : agent === 'ada' ? 'Try in Ask Devin ↗' : 'Try in Devin ↗';
  const featureList = features ? features.split(',').map(f => f.trim()) : [];
  return <div className="uc-hero">
      <div className="uc-hero-inner">
        <div className="uc-hero-left">
          <h1 className="uc-hero-title">{title}</h1>
          <p className="uc-hero-desc">{description}</p>
          <div>
            <a href={devinHref} target="_blank" rel="noopener noreferrer" className="try-in-devin-btn">
              {buttonLabel}
            </a>
          </div>
        </div>
        <div className="uc-hero-meta">
          <div className="uc-meta-item">
            <span className="uc-meta-label">Author</span>
            <span className="uc-meta-value">Cognition</span>
          </div>
          <div className="uc-meta-item">
            <span className="uc-meta-label">Category</span>
            <span className="uc-meta-value">{category}</span>
          </div>
          {featureList.length > 0 && <div className="uc-meta-item">
              <span className="uc-meta-label">Features</span>
              <span className="uc-meta-value">{featureList.join(', ')}</span>
            </div>}
        </div>
      </div>
    </div>;
};

export const PromptBlock = ({children, type, agent, intent, playbookId}) => {
  var utm = 'utm_source=docs&utm_medium=use-case-gallery&utm_campaign=prompt-block';
  var tag = 'docs-use-case-gallery';
  var agentParams = (agent ? '&agent=' + agent : '') + (intent ? '&intent=' + intent : '') + (playbookId ? '&playbookId=' + playbookId : '');
  var label = type === 'schedule' ? 'Schedule in Devin' : type === 'playbook' ? 'Create Playbook' : type === 'knowledge' ? 'Add to Knowledge' : agent === 'advanced' ? 'Try in Devin' : agent === 'dana' ? 'Try in Dana' : agent === 'ada' ? 'Try in Ask Devin' : 'Try in Devin';
  var buildUrl = function (text) {
    var encoded = encodeURIComponent(text);
    if (type === 'schedule') return 'https://app.devin.ai/settings/schedules/create?' + utm + agentParams + '&prompt=' + encoded;
    if (type === 'playbook') return 'https://app.devin.ai/settings/playbooks/create?' + utm + '&body=' + encoded;
    if (type === 'knowledge') return 'https://app.devin.ai/knowledge?' + utm + '&body=' + encoded;
    if (agent === 'ada') return 'https://app.devin.ai/search?' + utm + '&noSubmit=true&prompt=' + encoded;
    return 'https://app.devin.ai/?tags=' + tag + '&' + utm + agentParams + '&prompt=' + encoded;
  };
  const ref = React.useRef(null);
  const [href, setHref] = React.useState('#');
  React.useEffect(() => {
    if (!ref.current) return;
    var codeEl = ref.current.querySelector('pre code');
    if (codeEl) {
      var text = codeEl.textContent.trim();
      if (text) setHref(buildUrl(text));
    }
    var header = ref.current.querySelector('[data-component-part="code-block-header"]');
    if (header && !header.querySelector('.prompt-block-devin-link')) {
      var link = document.createElement('a');
      link.href = href;
      link.target = '_blank';
      link.rel = 'noopener noreferrer';
      link.className = 'prompt-block-devin-link';
      link.style.cssText = 'display:inline-flex;align-items:center;gap:6px;text-decoration:none;color:#fff;font-size:11px;font-weight:500;padding:4px 10px;border-radius:6px;white-space:nowrap;background:#317CFF;transition:background 0.2s;margin-left:8px;';
      link.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg> ' + label;
      link.onmouseenter = function () {
        link.style.background = '#2968D9';
      };
      link.onmouseleave = function () {
        link.style.background = '#317CFF';
      };
      header.appendChild(link);
    }
    var existingLink = ref.current.querySelector('.prompt-block-devin-link');
    if (existingLink && href !== '#') existingLink.href = href;
  });
  return <div className="prompt-block" ref={ref}>{children}</div>;
};

<UseCaseHero title="批量规划工单待办列表" description="在 Linear 中多选工单，为整个待办列表生成带置信度评分的实施方案。" prompt="请审查当前冲刺待办列表中的所有工单。对每个工单分析代码库，给出一个置信度评分（绿色/黄色/红色），并将实施方案作为评论发布在该工单下。不要开始具体实施——只做范围界定。" category="项目管理" features="集成, 操作手册" devinUrl="https://app.devin.ai/settings/connections/linear" />

<div className="uc-detail-wrapper">
  <Tip>不想手动完成这些设置？将本页链接粘贴到 Devin 会话中，让它帮你完成所有配置。</Tip>

  <Steps>
    <Step title="连接 Linear">
      前往 [**Settings > Connections > Linear**](https://app.devin.ai/settings/connections/linear?utm_source=docs\&utm_medium=use-case-gallery)，然后点击 **Connect**。你将授权 Devin 访问你的工作区，并选择它可以查看的团队。如果你团队使用的是 [Jira](/zh/integrations/jira) 作为工单系统，也可以改用 Jira 集成。

      当你的 [Linear](/zh/integrations/linear) 集成激活后，在 Linear 设置中查看 **Synced playbook labels** 部分。`!plan` [playbook](https://app.devin.ai/settings/playbooks/b0d9a34380374c3e903d900d340d8da7?utm_source=docs\&utm_medium=use-case-gallery) 被设为默认 —— 它会指示 Devin 分析并评论工单，而不编写代码。

      <Note>要让 playbook 标签自动同步到 Linear，你的 Linear 工作区必须将 **Manage workspace labels** 设置为 **All members** (位于 Linear 的 **Settings > Security** 中) 。如果未启用此设置，你需要在 Linear 中手动创建这些标签。</Note>
    </Step>

    <Step title="选择工单并添加“Devin”标签">
      在 [**Linear**](https://linear.app) 中打开 backlog，按 **Cmd+A** 多选工单 (或使用 Shift+单击选择特定范围) ，然后右键点击并选择 **Add label > Devin**。如果要使用特定的 playbook，请从 **Devin Playbooks** 标签组中选择已同步的标签，例如 `!plan`。

      Devin 会并行对每个选中的工单进行范围评估。几分钟内，每个工单都会收到一条详细评论，其中包含置信度评分和实现方案。
    </Step>

    <Step title="查看 Devin 对每个工单的分析">
      Devin 会在每个工单上直接发布一条结构化评论。每条评论都会包含一个**置信度分数** (🟢 🟡 🔴) 、它在你的代码库中找到的**相关文件和模块**、逐步的**实现计划**，以及在 Devin 继续执行前需要人类先回答的所有**未决问题**。

      | 工单      | 标题               | 评分 | Devin 的发现                                                               |
      | ------- | ---------------- | -- | ----------------------------------------------------------------------- |
      | FE-412  | 深色模式开关           | 🟢 | 在 `src/contexts/ThemeContext.tsx` 中已存在主题上下文；在另外 3 处设置中使用了相同的开关模式        |
      | FE-419  | 日期选择器时区错误        | 🟢 | 问题已定位在 `src/utils/dates.ts` 中的 `formatLocalDate()`；缺少单元测试               |
      | BE-203  | 将首选项迁移到 Postgres | 🟡 | 分布在 6 个服务中的 14 个调用点——需要进一步澄清回滚策略                                        |
      | BE-210  | Webhook 限流       | 🟢 | 在 `src/middleware/rateLimiter.ts` 中已有现成的限流中间件；只需进行配置                    |
      | INF-102 | k8s 健康检查         | 🟢 | 在 `/healthz` 下已存在就绪探针 (readiness probe) ；存活探针 (liveness probe) 可以沿用相同模式 |

      **评分含义如下：**

      * **🟢 Green** — Devin 可以完全自主处理。点击 Devin 评论中的链接即可立即启动会话。
      * **🟡 Yellow** — Devin 有具体问题需要澄清。在工单讨论串中或在 [Spaces](/zh/product-guides/knowledge) 中回答这些问题，Devin 会重新评估——通常会升级为绿色。
      * **🔴 Red** — 更适合指派给人类工程师处理，但 Devin 的代码库分析仍能帮助你更快完成工作量和范围评估。

      <Tip>安装 Linear 集成后，Devin 可以原生访问 Linear 的工具——因此你的 playbook 可以指示 Devin 根据其发现来更新工单标签。例如，Devin 可以根据自己的置信度分数为每个工单添加 `Green`、`Yellow` 或 `Red` 标签。由于标签可以触发其他自动化流程，你可以串联工作流——例如，`Green` 标签可以触发第二个 Devin 会话来开始实现工作。</Tip>
    </Step>

    <Step title="为持续规划设置自动化触发条件">
      与其每次手动给工单添加标签，不如配置一个**自动化触发器**，让新工单一进入你的 backlog 就自动纳入规划。

      在 [**Settings > Connections > Linear**](https://app.devin.ai/settings/connections/linear?utm_source=docs\&utm_medium=use-case-gallery) 中，滚动到 **Automation triggers** 并点击 **Add trigger**：

      * **Teams**：选择要自动规划的团队 (例如："Engineering"、"Platform")
      * **Statuses**：当工单移动到特定状态时触发，例如 "Triage" 或 "Todo"
      * **Labels**：可选地限制为特定标签 (例如，仅对带有 `Feature` 或 `Improvement` 的工单生效)
      * **Playbook**：选择 `!plan`，这样 Devin 会进行范围评估并添加评论，但不会编写代码

      <Tip>你可以复制 `!plan` [template playbook](https://app.devin.ai/settings/playbooks/b0d9a34380374c3e903d900d340d8da7?utm_source=docs\&utm_medium=use-case-gallery)，并为你的组织进行自定义——例如，调整输出格式、添加特定仓库的说明，或更改 Devin 在评论中包含的详细信息。</Tip>

      触发器使用 [edge detection](/zh/integrations/linear) 机制——它们只会在工单*转换*到匹配状态时触发，而不会对已经处于该状态的工单触发。现在，进入你 "Todo" 列的每一个新工单都会预先完成分析，附带置信度评分和实现计划，方便你的团队进行评审和优先级排期。
    </Step>
  </Steps>
</div>
