PLT-7263: truncate long issue descriptions (#7142)
* truncate long issue descriptions, add tests * minor tweak to text template * add license header * remove tests for now (since dependency is blocked) * remove second jira link
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
2c8fe15cc8
Коммит
2853b3a47b
@@ -92,7 +92,11 @@ func (w *Webhook) SlackAttachment() (*model.SlackAttachment, error) {
|
||||
text, err := w.renderText("" +
|
||||
"[{{.Issue.Fields.Summary}}]({{.JIRAURL}}/browse/{{.Issue.Key}})" +
|
||||
"{{if eq .WebhookEvent \"jira:issue_created\"}}{{if ne .Issue.Fields.Description \"\"}}" +
|
||||
"{{if len .Issue.Fields.Description | lt 3000}}" +
|
||||
"\n\n{{printf \"%.3000s\" .Issue.Fields.Description}}..." +
|
||||
"{{else}}" +
|
||||
"\n\n{{.Issue.Fields.Description}}" +
|
||||
"{{end}}" +
|
||||
"{{end}}{{end}}" +
|
||||
"")
|
||||
if err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user