[Bps-public-commit] rt-extension-notifyslack branch, craig, updated. f421b80ca2a5ce7397c1828ce06c3e0d7605e7e7

Craig Kaiser craig at bestpractical.com
Thu Nov 8 16:42:17 EST 2018


The branch, craig has been updated
       via  f421b80ca2a5ce7397c1828ce06c3e0d7605e7e7 (commit)
      from  c034307428f8316bf536169c2edab3c914059e7c (commit)

Summary of changes:
 lib/RT/Action/NotifySlack.pm | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

- Log -----------------------------------------------------------------
commit f421b80ca2a5ce7397c1828ce06c3e0d7605e7e7
Author: Craig Kaiser <craig at bestpractical.com>
Date:   Thu Nov 8 16:40:47 2018 -0500

    No need to commit a new transaction scrips will handle that

diff --git a/lib/RT/Action/NotifySlack.pm b/lib/RT/Action/NotifySlack.pm
index e7044ef..954ede5 100644
--- a/lib/RT/Action/NotifySlack.pm
+++ b/lib/RT/Action/NotifySlack.pm
@@ -39,7 +39,7 @@ sub Commit {
     $ua->timeout(15);
 
     # prevent infinite loop between RT and Slack
-    return 0 if $txn->Type eq 'SlackNotified';
+    return 0 if $self->TransactionObj->Type eq 'SlackNotified';
 
     my $payload = $self->TemplateObj->MIMEObj->as_string;
 
@@ -47,12 +47,7 @@ sub Commit {
 
     my $resp = $ua->request($req);
 
-    if ($resp->is_success) {
-        RT::Logger->debug('Posted to slack!');
-        $ticket->_NewTransaction( Type => 'SlackNotified' );
-    } else {
-        RT::Logger->debug("Failed post to slack, status is:" . $resp->status_line);
-    }
+    RT::Logger->debug("Failed post to slack, status is:" . $resp->status_line) unless $resp->is_success;
 
     return 1;
 }

-----------------------------------------------------------------------


More information about the Bps-public-commit mailing list