diff --git a/create_ticket_api.php b/create_ticket_api.php index a479e94..3401e3f 100644 --- a/create_ticket_api.php +++ b/create_ticket_api.php @@ -271,20 +271,10 @@ if ($existing) { $updStmt->execute(); $updStmt->close(); - // Only add a comment when something meaningful changed (not just a description refresh) - $meaningfulChanges = array_diff_key($changes, ['description_refreshed' => true]); - if (!empty($meaningfulChanges)) { - $changeLines = []; - if (isset($changes['title'])) { - $changeLines[] = "- **Title updated** to reflect current issue"; - } - if (isset($changes['priority'])) { - $changeLines[] = "- **Priority escalated** from P{$changes['priority']['from']} to P{$changes['priority']['to']}"; - } - // Wrap description in a fenced code block so ASCII art / box-drawing - // characters render correctly instead of collapsing into a paragraph blob - $commentText = "**hwmonDaemon reported a worsened condition — ticket updated automatically.**\n\n" . - implode("\n", $changeLines) . "\n\nLatest report:\n\n```\n" . $description . "\n```"; + // Only post a comment on priority escalation — title and description updates + // are silent (title changes like rising counters would spam a comment every run) + if (isset($changes['priority'])) { + $commentText = "**hwmonDaemon escalated this ticket from P{$changes['priority']['from']} to P{$changes['priority']['to']}.**\n\n```\n" . $description . "\n```"; $commentStmt = $conn->prepare( "INSERT INTO ticket_comments (ticket_id, user_id, user_name, comment_text, markdown_enabled) VALUES (?, ?, 'hwmonDaemon', ?, 1)" );