From f23da993e6c6e3cbb0ba0dd0c70af2c297932cb5 Mon Sep 17 00:00:00 2001 From: Sandip Agarwal Date: Wed, 30 Nov 2016 13:36:29 +0530 Subject: [PATCH] add the issue link to visible directly in the notification --- setup.py | 2 +- src/sentry_slack/plugin.py | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 66fccc8..0a04125 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ setup( name='sentry-slack', - version='0.5.0', + version='0.5.1', author='Matt Robenolt', author_email='matt@ydekproductons.com', url='https://github.com/getsentry/sentry-slack', diff --git a/src/sentry_slack/plugin.py b/src/sentry_slack/plugin.py index b71febf..c491e7d 100644 --- a/src/sentry_slack/plugin.py +++ b/src/sentry_slack/plugin.py @@ -147,10 +147,8 @@ def notify(self, notification): channel = (self.get_option('channel', project) or '').strip() title = group.message_short.encode('utf-8') - if group.culprit: - culprit = group.culprit.encode('utf-8') - else: - culprit = None + title_link = group.get_absolute_url() + culprit = group.culprit.encode('utf-8') if group.culprit else None project_name = get_project_full_name(project).encode('utf-8') fields = [] @@ -170,6 +168,12 @@ def notify(self, notification): 'short': True, }) + fields.append({ + 'title': 'Issue Link', + 'value': title_link, + 'short': False, + }) + if self.get_option('include_rules', project): rules = [] for rule in notification.rules: @@ -209,7 +213,7 @@ def notify(self, notification): 'attachments': [{ 'fallback': '[%s] %s' % (project_name, title), 'title': title, - 'title_link': group.get_absolute_url(), + 'title_link': title_link, 'color': self.color_for_group(group), 'fields': fields, }]