Skip to content

Commit

Permalink
LinearNotification: use TEAM-123 as link text
Browse files Browse the repository at this point in the history
  • Loading branch information
rjbs committed Jun 27, 2024
1 parent f2f7e12 commit 091bf32
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lib/Synergy/Reactor/LinearNotification.pm
Original file line number Diff line number Diff line change
Expand Up @@ -150,25 +150,29 @@ sub http_app ($self, $env) {
my $app = $was_create ? 'Zendesk' : 'Linear';
$who = 'someone' unless $was_create;

my $text = sprintf
"%s %s escalation by %s in %s: %s (%s)",
my $base_text = sprintf
"%s %s escalation by %s in %s: %s",
$ESCALATION_EMOJI,
$desc,
$who,
$app,
$payload->{data}{title},
$payload->{url};
$payload->{data}{title};

my ($identifier) = $payload->{url} =~ m{/linear\.app/fastmail/issue/([A-Z]+-[0-9]+)/};
$identifier //= $payload->{url};
my $text = "$base_text ($payload->{url})";
my $slack = "$base_text (<$payload->{url}|$identifier>)";

if (my $rototron = $self->_rototron) {
my $roto_reactor = $self->hub->reactor_named('rototron');

for my $officer ($roto_reactor->current_triage_officers) {
$Logger->log(["notifying %s of new escalation task", $officer->username ]);
$channel->send_message_to_user($officer, $text);
$channel->send_message_to_user($officer, $text, { slack => $slack });
}
}

return $channel->send_message($self->escalation_address, $text);
return $channel->send_message($self->escalation_address, $text, { slack => $slack });
})->catch(sub {
$Logger->log("failed to tell escalation about a ticket create in linear: @_");

Expand Down

0 comments on commit 091bf32

Please sign in to comment.