From 096df55436005f06ad3fdefa3f015aebe50ffc1b Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 1 Oct 2013 14:30:49 -0400 Subject: [PATCH] trac: Include ticket summaries in body if they were truncated. (imported from commit df1bd5e765725d077cc30ce92eac8bf694145044) --- integrations/trac/zulip_trac.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/integrations/trac/zulip_trac.py b/integrations/trac/zulip_trac.py index 0c21002..e726be7 100644 --- a/integrations/trac/zulip_trac.py +++ b/integrations/trac/zulip_trac.py @@ -80,8 +80,11 @@ class ZulipPlugin(Component): content = "%s created %s in component **%s**, priority **%s**:\n" % \ (ticket.values.get("reporter"), markdown_ticket_url(ticket), ticket.values.get("component"), ticket.values.get("priority")) + # Include the full subject if it will be truncated + if len(ticket.values.get("summary")) > 60: + content += "**%s**\n" % (ticket.values.get("summary"),) if ticket.values.get("description") != "": - content += "%s" % markdown_block(ticket.values.get("description")) + content += "%s" % (markdown_block(ticket.values.get("description")),) send_update(ticket, content) def ticket_changed(self, ticket, comment, author, old_values): @@ -96,7 +99,7 @@ class ZulipPlugin(Component): content = "%s updated %s" % (author, markdown_ticket_url(ticket)) if comment: - content += ' with comment: %s\n\n' % (markdown_block(comment,)) + content += ' with comment: %s\n\n' % (markdown_block(comment),) else: content += ":\n\n" field_changes = []