fix(telegram): 修復 INC-INC- 重複前綴 (telegram_gateway.py)
問題: approval_id 已有 INC- 前綴時,又加了一次 修復: 檢查是否已有前綴再決定是否添加 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -157,8 +157,13 @@ class TelegramMessage:
|
||||
else:
|
||||
conf_emoji = "🔴"
|
||||
|
||||
# 自動生成事件編號
|
||||
incident_id = self.incident_id or f"INC-{self.approval_id[:8].upper()}"
|
||||
# 自動生成事件編號 (2026-03-26 修復: 檢查是否已有 INC- 前綴)
|
||||
if self.incident_id:
|
||||
incident_id = self.incident_id
|
||||
elif self.approval_id.upper().startswith("INC-"):
|
||||
incident_id = self.approval_id.upper()
|
||||
else:
|
||||
incident_id = f"INC-{self.approval_id[:8].upper()}"
|
||||
|
||||
# SignOz URL (優先使用動態 URL) - 必須 HTML 轉義防止解析錯誤
|
||||
service_name = self.resource_name.split("-")[0] if "-" in self.resource_name else self.resource_name
|
||||
|
||||
Reference in New Issue
Block a user