ChatGPT工作文档AI 评分 · 待评分AI 辅助编辑·未发现明显提示词注入风险n8n.io

Jira Epic 完成后自动生成经验教训报告并写入 Google Docs

Jira Epic 状态变为 Done → 拉取关联任务与评论 → AI 生成结构化 Lessons Learned 报告 → 写入指定 Google Docs 文档

经验丰富步骤流程提示词贴士
给谁
使用 Jira 管理 Epic 的敏捷团队,希望自动输出项目回顾文档
你会得到
Epic 关闭后自动触发,收集关联 issue 与评论,由 AI 按固定 Markdown 格式生成报告并插入 Google Docs
你需要
n8n · jira · google-docs

硬约束

需要 n8n 实例、Jira Cloud API 凭证、OpenAI API 凭证、Google Docs OAuth2 凭证,以及一个目标 Google Docs 文档 ID。模板使用 gpt-4o-mini 作为默认模型,支持切换同系列模型。AI Agent 通过 System Message 定义输出格式,Simple Memory 提供会话窗口记忆。

他们做了什么

作者 tarekadam 在 n8n 模板库发布了一个工作流模板。该模板通过 Jira Trigger 监听 issue_updated 事件,经 If 节点过滤 Epic 状态变为 Done 的情况,随后串联 Jira Get All Issues、Jira Get All Comments、Edit Fields、Summarize、AI Agent(OpenAI Chat Model + Simple Memory)和 Google Docs 节点,实现从触发到文档交付的自动化。

效果如何

模板在 n8n 官方模板库状态为 published,展示次数 7930 次(来源报告,author_report)。模板提供了完整的 System Message 以规范 AI 输出格式,并针对 Google Docs 兼容性做了格式约定。

值得知道

1. 模板默认使用 gpt-4o-mini,可在 OpenAI Chat Model 节点切换为 gpt-4o 等同系列模型。 2. Jira Trigger 的 additionalFields.filter 为空,若 Jira 项目量大建议补充 JQL 过滤条件以减少无关触发。 3. Google Docs 节点需要用户自行提供 documentURL,模板中该值为空字符串。 4. Edit Fields 节点中的 Comment 提取表达式为 $json.body.content[0].content[0].text,若评论结构复杂可能取不到完整内容。 5. 本站未对该模板进行实测导入与运行验证(reproduction=not_tested),搭建时请先用测试数据验证。

n8n 工作流模板

结构已检查 · 未实际运行

下载后在 n8n 选择“Import from File”,或复制 JSON 后粘贴到编辑器。先配置自己的账号,再用测试数据运行;模板默认未启用。

配置与测试清单

需要绑定的凭证

  • Jira Get All Issues 节点:绑定jiraSoftwareCloudApi 凭证。
  • Jira Get All Comments 节点:绑定jiraSoftwareCloudApi 凭证。
  • OpenAI Chat Model 节点:绑定OpenAI API 凭证。
  • Google Docs 节点:绑定googleDocsOAuth2Api 凭证。
  • Jira Trigger 节点:绑定jiraSoftwareCloudApi 凭证。

需要替换的配置

  • 源模板来自 n8n 公开库 #3934(约 13 个节点)。导入后先保持未启用,核对触发器、表达式与外部 API 端点。
  • Sticky Note 中的说明仅供参考;按自己的账号、表结构或频道 ID 替换占位配置。

测试输入与预期结果

  • 在测试环境手动执行一次主路径,确认每个需凭证的节点已连接且无鉴权错误。
  • 用一条合成/脱敏样例数据跑通,核对输出字段与下游写入目标,再考虑生产启用。

模板处理说明

  • 已移除原作者凭证绑定、webhookId 与执行数据,工作流设为未启用;节点、连线与原文提示词保持原样。未在 n8n 中实际运行。
  • 未改业务逻辑;运行前请自行核对密钥、配额与隐私合规。

模板获取日期: 2026-10-24

步骤

  1. 配置触发器与 Done 状态过滤

    在 n8n 中添加 Jira Trigger 节点,选择事件 jira:issue_updated。随后添加 If 节点,设置条件判断 changelog.items[0].toString 等于 Done,确保仅在 Epic 状态变为 Done 时继续执行。

  2. 获取 Epic 下 issue 与评论并汇总字段

    依次添加 Jira Get All Issues 和 Jira Get All Comments 节点,使用同一 Jira 凭证。通过 Edit Fields(Set)节点提取 EpicName、EpicStatus、Title、Description、Comment 五个字段,其中 Comment 取自评论体文本。随后用 Summarize 节点按 EpicName/EpicStatus/Title/Description 分组,将 Comment 字段以换行符 concatenate 聚合为 concatenated_Comment。

  3. 配置 AI Agent 生成报告

    添加 AI Agent 节点,连接 OpenAI Chat Model(默认 gpt-4o-mini)和 Simple Memory。在 AI Agent 的 Text 字段填入用户输入模板,在 Options > System Message 中粘贴来源提供的完整 System Message。该 System Message 定义了 Lessons Learned 报告的 Markdown 结构、Google Docs 兼容性格式(星号列表、双空格换行、反引号代码等)以及内容要求。

    运行提示词 · 来源原文。AI Agent 节点的 Text 输入字段(promptType=define 时的用户消息模板)

    =comments = {{ $json.concatenated_Comment }}
    description = {{ $json.Description }}
    title = {{ $json.Title }}
    status = {{ $json.EpicStatus }}
    epic_name = {{ $json.EpicName }}

    运行提示词 · 来源原文。AI Agent 节点的 Options > System Message 字段

    =You are an AI assistant specialized in creating comprehensive Agile retrospective documents. Your task is to analyze the provided information about a completed task and generate an insightful **Lessons Learned** report formatted in **clean Markdown**, optimized for seamless conversion to Google Docs.
    
    ---
    
    ### 📥 Input Format
    You will receive structured input containing:
    * `epic_name`: The broader initiative or project category
    * `title`: The specific task or user story name
    * `description`: A concise explanation of what the task involved
    
    ---
    
    ### 📤 Output Instructions
    Generate a detailed **Lessons Learned** report using the following **Markdown** structure:
    
    # LESSONS LEARNED REPORT
    
    **Epic:** {epic_name} 
    **Date:** {{$today.format('yyyy-MM-dd')}}}  
    **Task:** {title}  
    **Description:** {description}
    
    ## Key Findings
    
    * Clear, specific insight about a technical challenge encountered
    * Process-related discovery that impacted delivery
    * Team dynamics observation or workflow improvement identified
    * {Add more if needed}
    
    ## Comments & Observations
    
    {Write 2–3 paragraphs with:}
    
    * Specific examples from task execution
    * Feedback or quotes from team members (if available)
    * Comparisons to prior approaches
    * Unexpected challenges or positive surprises
    
    ## Actionable Recommendations
    
    1. Specific, implementable action to address a finding
    2. Concrete suggestion for process improvement
    3. Recommendation for knowledge sharing or team development
    4. {Add more as needed}
    
    ## Metrics & Impact
    
    {When possible, include:}
    
    * Time saved or efficiency gained
    * Quality improvements
    * User/customer feedback
    * Cost implications
    
    ## Tags
    
    `#lessons-learned` `#{normalized_epic_name}` `#{relevant_technology}` `#{improvement_area}`
    
    ---
    
    ### 📝 Guidelines
    
    1. **Be specific** – use real details, not vague statements
    2. **Stay relevant** – stick to the task and its broader context
    3. **Focus on learning** – prioritize transferable insights
    4. **Balance** – include both wins and challenges
    5. **Actionability** – make every suggestion doable
    6. **Concise yet clear** – avoid fluff; write for impact
    7. **Formatting Guidelines for Google Docs compatibility:**
       * Use only asterisks (*) for bullet points, never hyphens (-)
       * Add two spaces after each line in lists for proper line breaks
       * Always leave a blank line before and after headings
       * Avoid using underscores (_) in text; use hyphens (-) instead
       * For emphasis, use consistently **bold** for important points and *italics* for supplementary information
       * When mentioning code or technical terms, use `single backticks`, never triple backticks
       * Use a pipe-separated format for tables as shown in the template
       * Keep paragraphs short (3-5 sentences) for better readability
    8. **Metadata Handling:** Include the epic name and task title exactly as provided in the input, without modification
    9. **Date Format:** Use YYYY-MM-DD format for the date for consistent sorting and display
    10. **Tags:** Keep tags lowercase, with hyphens instead of spaces, and relevant to the content
    
    ---
  4. 配置 Google Docs 输出节点

    添加 Google Docs 节点,选择操作 update,在 documentURL 填入目标文档链接或 ID。在 actionsUi > actionFields 中设置 action 为 insert,text 为 {{ $json.output }},将 AI Agent 的输出插入文档。

可复制提示词

搭建指导 · 本站建议版本。交给搭建助手,先确认输入和权限

这一段是提示词,页面不会在这里插入广告。

你正在搭建一个 n8n 工作流:当 Jira Epic 状态变为 Done 时,自动收集该 Epic 下的所有 issue 与评论,由 AI 生成结构化的 Lessons Learned 报告,并写入指定的 Google Docs 文档。

前置检查清单:
- [ ] 拥有可访问的 n8n 实例(自托管或 Cloud)
- [ ] 已创建 Jira Cloud API 凭证(jiraSoftwareCloudApi)
- [ ] 已创建 OpenAI API 凭证(openAiApi)
- [ ] 已创建 Google Docs OAuth2 凭证(googleDocsOAuth2Api)
- [ ] 已准备目标 Google Docs 文档并获取其 ID/URL
- [ ] 在 Jira 中确认 Epic 工作流包含 Done 状态

建议先导入模板 workflow.json,然后按上述步骤核对节点参数,特别是 AI Agent 的 System Message 和 Google Docs 的 documentURL。首次运行前使用测试 Epic 验证输出格式。

如需调整报告风格,修改 AI Agent 的 System Message 即可,不要改动节点连线。

来源

Generate lessons learned reports from Jira epics with AI and Google Docs · tarekadam · n8n.io · 2025-05-08

留言与反馈

试过这个方法吗?分享效果、遇到的问题或改进建议。留言审核后公开,请勿填写敏感信息。

正在加载…

    相关用例