From 7723c4b812e3867e74448ae604b162bfa789943d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Tue, 22 Oct 2024 14:31:55 +0200 Subject: [PATCH] fix summary --- pkg/notify/notify.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/notify/notify.go b/pkg/notify/notify.go index e4b96a2..027dc1b 100644 --- a/pkg/notify/notify.go +++ b/pkg/notify/notify.go @@ -86,8 +86,13 @@ func (r *Receiver) Notify(data *alertmanager.Data, hashJiraLabel bool, updateSum return false, errors.Wrap(err, "render issue description") } + if len(issueSummary) > 255 { + level.Info(r.logger).Log("msg", "truncating summary", "original", len(issueSummary), "limit", 255) + issueSummary = issueDesc[:255] + } + if len(issueDesc) > maxDescriptionLength { - level.Warn(r.logger).Log("msg", "truncating description", "original", len(issueDesc), "limit", maxDescriptionLength) + level.Info(r.logger).Log("msg", "truncating description", "original", len(issueDesc), "limit", maxDescriptionLength) issueDesc = issueDesc[:maxDescriptionLength] }