Esempio n. 1
0
    def build(self) -> SlackBody:
        if self.notification.is_message_issue_unfurl:
            return SlackIssuesMessageBuilder(
                group=self.notification.group,
                event=getattr(self.notification, "event", None),
                tags=self.context.get("tags", None),
                rules=getattr(self.notification, "rules", None),
                issue_details=True,
                notification=self.notification,
                recipient=self.recipient,
            ).build()

        if isinstance(self.notification, ReleaseActivityNotification):
            return self._build(
                actions=build_deploy_buttons(self.notification),
                footer=build_notification_footer(self.notification,
                                                 self.recipient),
            )

        return self._build(
            title=build_attachment_title(self.notification.group),
            title_link=get_title_link(self.notification.group, None, False,
                                      False, self.notification),
            text=self.notification.get_message_description(),
            footer=build_notification_footer(self.notification,
                                             self.recipient),
            color="info",
        )
Esempio n. 2
0
    def get_title_link(self) -> str | None:
        from sentry.integrations.slack.message_builder.issues import get_title_link

        return get_title_link(self.group, None, False, True, self)