luhaowen 5 days ago
parent
commit
e98fefe51d
1 changed files with 6 additions and 12 deletions
  1. 6 12
      src/com/example/FeishuNotifier.groovy

+ 6 - 12
src/com/example/FeishuNotifier.groovy

@@ -23,7 +23,7 @@ class FeishuNotifier implements Serializable {
                     (status == 'SUCCESS') ? '✅ 构建成功' :
                     (status == 'FAILURE') ? '❌ 构建失败' : '🟡 构建不稳定'
 
-        // 2. 飞书卡片:header + elements
+        // 2. 飞书极简卡片:header + elements
         def payload = [
             msg_type: 'interactive',
             card: [
@@ -32,18 +32,13 @@ class FeishuNotifier implements Serializable {
                         tag: 'plain_text',
                         content: title
                     ],
-                    template: color
+                    subtitle: [
+                        tag: 'lark_md',
+                        content: "**任务名称:${jobName}**"   // ← 关键改动
+                    ],
+                    template: color   // 左侧条颜色
                 ],
                 elements: [
-                    // 任务名称:一级标题,醒目
-                    [
-                        tag: 'div',
-                        text: [
-                            tag: 'lark_md',
-                            content: "# ${jobName}\n"
-                        ]
-                    ],
-                    // 其余详情
                     [
                         tag: 'div',
                         text: [
@@ -58,7 +53,6 @@ class FeishuNotifier implements Serializable {
 """.stripIndent()
                         ]
                     ],
-                    // 查看详情按钮
                     [
                         tag: 'action',
                         actions: [