8
n8n 中文网amn8n.com

Jira Epic健康评分与风险仪表板

高级

这是一个自动化工作流,包含 20 个节点。主要使用 If, Cron, Jira, Slack, Function 等节点。 通过Slack、Monday和Sheets自动风险提醒追踪Jira Epic健康状况

前置要求
  • Slack Bot Token 或 Webhook URL
  • Google Sheets API 凭证

分类

-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "KwWlPZAiObwL1LOi",
  "meta": {
    "instanceId": "8443f10082278c46aa5cf3acf8ff0f70061a2c58bce76efac814b16290845177"
  },
  "name": "Jira Epic 健康评分与风险仪表板",
  "tags": [],
  "nodes": [
    {
      "id": "5bb8e683-bde5-48d3-a424-1221f40f6580",
      "name": "每 6 小时触发一次",
      "type": "n8n-nodes-base.cron",
      "position": [
        -2864,
        1360
      ],
      "parameters": {
        "triggerTimes": {
          "item": [
            {
              "mode": "everyX",
              "value": 6
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a452f278-a5ea-443a-b98e-b33bb7d27aef",
      "name": "📊 工作流概览",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3216,
        1232
      ],
      "parameters": {
        "width": 280,
        "height": 256,
        "content": "📊 工作流开始"
      },
      "typeVersion": 1
    },
    {
      "id": "e051afef-6cb0-45aa-b244-51baacd48602",
      "name": "从 Jira 获取所有 Epic",
      "type": "n8n-nodes-base.jira",
      "position": [
        -2608,
        1360
      ],
      "parameters": {
        "options": {},
        "operation": "getAll"
      },
      "credentials": {
        "jiraSoftwareCloudApi": {
          "id": "Q6d7sLBVOfGWmaLw",
          "name": "Jira SW Cloud account vivek"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "aef82a98-c0db-40f6-a3bb-a9df4535ec98",
      "name": "📥 获取 Epic",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2752,
        1088
      ],
      "parameters": {
        "width": 280,
        "height": 236,
        "content": "📥 EPIC 检索"
      },
      "typeVersion": 1
    },
    {
      "id": "1d172b8c-c88f-4ab5-b6ce-19110edcd433",
      "name": "拆分 Epic 进行处理",
      "type": "n8n-nodes-base.function",
      "position": [
        -2368,
        1360
      ],
      "parameters": {
        "functionCode": "const output = [];\nfor (const epic of items) {\n  const key = epic.json.key;\n  output.push({ json: { epicKey: key }});\n}\nreturn output;"
      },
      "typeVersion": 1
    },
    {
      "id": "464b3b19-6f73-4a72-9dd4-8e77edb75439",
      "name": "🔀 拆分 Epic",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2496,
        1552
      ],
      "parameters": {
        "width": 280,
        "height": 316,
        "content": "🔀 拆分 EPIC"
      },
      "typeVersion": 1
    },
    {
      "id": "63fe1ee2-e389-42f7-81ee-a8cf7fca80f7",
      "name": "获取 Epic + 关联问题",
      "type": "n8n-nodes-base.jira",
      "position": [
        -2112,
        1360
      ],
      "parameters": {
        "issueKey": "={{ $json.epicKey }}",
        "operation": "get",
        "additionalFields": {}
      },
      "credentials": {
        "jiraSoftwareCloudApi": {
          "id": "Q6d7sLBVOfGWmaLw",
          "name": "Jira SW Cloud account vivek"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0f47c09d-d22d-423e-9be4-e43fe3c39d0b",
      "name": "🔗 获取关联项",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2208,
        1024
      ],
      "parameters": {
        "width": 280,
        "height": 300,
        "content": "🔗 获取关联问题"
      },
      "typeVersion": 1
    },
    {
      "id": "750efdd8-c544-41ee-aa9c-ac3c11df107a",
      "name": "计算健康评分",
      "type": "n8n-nodes-base.function",
      "position": [
        -1856,
        1360
      ],
      "parameters": {
        "functionCode": "const results = [];\n\nfor (const item of items) {\n  const issues = item.json.issues || [];\n  const total = issues.length || 1;\n\n  let cycleTime = 0;\n  let blockers = 0;\n  let churn = 0;\n  let bugs = 0;\n\n  for (const issue of issues) {\n    cycleTime += issue.fields.customfield_cycle_time || 0;\n    if (issue.fields.labels && issue.fields.labels.includes('blocker')) blockers++;\n    if (issue.fields.status && issue.fields.status.name === 'Reopened') churn++;\n    if (issue.fields.issuetype && issue.fields.issuetype.name === 'Bug') bugs++;\n  }\n\n  const avgCycleTime = cycleTime / total;\n  const bugRatio = bugs / total;\n  const churnRatio = churn / total;\n  const blockerRatio = blockers / total;\n\n  // Weighted scoring\n  const healthScore = (avgCycleTime * 0.4) + (bugRatio * 0.3) + (churnRatio * 0.2) + (blockerRatio * 0.1);\n\n  results.push({\n    json: {\n      epicKey: item.json.epicKey || item.json.key,\n      healthScore: Number(healthScore.toFixed(2))\n    }\n  });\n}\n\nreturn results;\n"
      },
      "typeVersion": 1
    },
    {
      "id": "c8f3a361-a296-461d-93f8-3472d1f9f337",
      "name": "📈 健康评分",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1968,
        1536
      ],
      "parameters": {
        "width": 280,
        "height": 376,
        "content": "📈 健康评分算法"
      },
      "typeVersion": 1
    },
    {
      "id": "8aee7bd4-f155-4540-9598-d8923556673c",
      "name": "评分是否 > 0.6(有风险)?",
      "type": "n8n-nodes-base.if",
      "position": [
        -1616,
        1360
      ],
      "parameters": {
        "conditions": {
          "number": [
            {
              "value1": "={{$json[\"healthScore\"]}}",
              "value2": 0.6,
              "operation": "larger"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e33d520e-955a-4ca2-9e11-1aaf8a078dfe",
      "name": "⚠️ 风险检查",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1792,
        1008
      ],
      "parameters": {
        "width": 280,
        "height": 316,
        "content": "⚠️ 风险阈值"
      },
      "typeVersion": 1
    },
    {
      "id": "7a14fe1b-bd86-4040-8655-0e8d48f5e35e",
      "name": "在 Jira 中更新 Epic",
      "type": "n8n-nodes-base.jira",
      "position": [
        -1344,
        1024
      ],
      "parameters": {
        "issueKey": "={{$json[\"epicKey\"]}}",
        "operation": "update",
        "updateFields": {
          "labels": [
            "At Risk"
          ],
          "customFieldsUi": {
            "customFieldsValues": [
              {
                "fieldId": "customfield_10060",
                "fieldValue": "={{$json[\"healthScore\"]}}"
              }
            ]
          }
        }
      },
      "credentials": {
        "jiraSoftwareCloudApi": {
          "id": "Q6d7sLBVOfGWmaLw",
          "name": "Jira SW Cloud account vivek"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "dc4eba68-ee7f-4226-8369-3fdeaf7806d7",
      "name": "🔄 Jira 更新",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1440,
        720
      ],
      "parameters": {
        "width": 280,
        "height": 268,
        "content": "🔄 JIRA 更新"
      },
      "typeVersion": 1
    },
    {
      "id": "48ef861d-0de4-4424-b453-a5a26f94716f",
      "name": "提醒 Slack 频道",
      "type": "n8n-nodes-base.slack",
      "position": [
        -1360,
        1200
      ],
      "parameters": {
        "text": "🚨 *Epic At Risk:* {{$json[\"epicKey\"]}}\nHealth Score: {{$json[\"healthScore\"]}}\nhttps://yourdomain.atlassian.net/browse/{{$json[\"epicKey\"]}}",
        "channel": "#project-alerts",
        "attachments": [],
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "id": null,
          "name": "Your Slack Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "822fc9ef-2efe-45a5-9bdf-4d4cd5bc14a2",
      "name": "🚨 Slack 提醒",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1168,
        1168
      ],
      "parameters": {
        "width": 280,
        "height": 268,
        "content": "🚨 SLACK 提醒"
      },
      "typeVersion": 1
    },
    {
      "id": "cd79db68-7aad-43bf-a436-75e377daa0fa",
      "name": "更新 Monday.com Pulse",
      "type": "n8n-nodes-base.mondayCom",
      "position": [
        -1280,
        1552
      ],
      "parameters": {
        "operation": "update"
      },
      "credentials": {
        "mondayComApi": {
          "id": null,
          "name": "Your Monday Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "03da2282-3393-4c2d-b81b-66d8527e2873",
      "name": "📋 Monday Pulse",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1072,
        1488
      ],
      "parameters": {
        "width": 280,
        "height": 300,
        "content": "📋 MONDAY.COM PULSE"
      },
      "typeVersion": 1
    },
    {
      "id": "716d2c3b-5cc4-4358-8f1a-c89844774af6",
      "name": "记录到 Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1280,
        1760
      ],
      "parameters": {
        "range": "A:C",
        "options": {
          "valueInputMode": "USER_ENTERED"
        },
        "sheetId": "Your Google Sheet ID",
        "operation": "append"
      },
      "credentials": {
        "googleApi": {
          "id": null,
          "name": "Your Google Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "41c60824-3019-4cc1-8284-1ca48deb52f4",
      "name": "📊 Sheets 日志",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1408,
        1920
      ],
      "parameters": {
        "width": 280,
        "height": 332,
        "content": "📊 GOOGLE SHEETS 日志"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "258c9a43-6f98-43c1-bbe4-91090329165b",
  "connections": {
    "Trigger Every 6 Hours": {
      "main": [
        [
          {
            "node": "Fetch All Epics from Jira",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Health Score": {
      "main": [
        [
          {
            "node": "Is Score > 0.6 (At Risk)?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch All Epics from Jira": {
      "main": [
        [
          {
            "node": "Split Epics for Processing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Score > 0.6 (At Risk)?": {
      "main": [
        [
          {
            "node": "Update Epic in Jira",
            "type": "main",
            "index": 0
          },
          {
            "node": "Alert Slack Channel",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update Monday.com Pulse",
            "type": "main",
            "index": 0
          },
          {
            "node": "Log to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Epic + Linked Issues": {
      "main": [
        [
          {
            "node": "Calculate Health Score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Epics for Processing": {
      "main": [
        [
          {
            "node": "Fetch Epic + Linked Issues",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量20
分类-
节点类型8
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Rahul Joshi

Rahul Joshi

@rahul08

Rahul Joshi is a seasoned technology leader specializing in the n8n automation tool and AI-driven workflow automation. With deep expertise in building open-source workflow automation and self-hosted automation platforms, he helps organizations eliminate manual processes through intelligent n8n ai agent automation solutions.

外部链接
在 n8n.io 查看

分享此工作流