Merge pull request #15799 from Godmartinz/update_deprecated_trigger_for_ms_teams

Updated deprecated trigger for ms teams
This commit is contained in:
snipe
2024-11-13 00:55:53 +00:00
committed by GitHub
2 changed files with 12 additions and 2 deletions

View File

@@ -175,8 +175,14 @@ class CheckoutableListener
// Send Webhook notification
try {
if ($this->shouldSendWebhookNotification()) {
Notification::route(Setting::getSettings()->webhook_selected, Setting::getSettings()->webhook_endpoint)
->notify($this->getCheckinNotification($event));
if (Setting::getSettings()->webhook_selected === 'microsoft') {
$message = $this->getCheckinNotification($event)->toMicrosoftTeams();
$notification = new TeamsNotification(Setting::getSettings()->webhook_endpoint);
$notification->success()->sendMessage($message[0], $message[1]); // Send the message to Microsoft Teams
} else {
Notification::route(Setting::getSettings()->webhook_selected, Setting::getSettings()->webhook_endpoint)
->notify($this->getCheckinNotification($event));
}
}
} catch (ClientException $e) {
Log::warning("Exception caught during checkin notification: " . $e->getMessage());

View File

@@ -113,6 +113,10 @@ class SlackSettingsForm extends Component
if($this->webhook_selected == 'microsoft' || $this->webhook_selected == 'google'){
$this->webhook_channel = '#NA';
}
}
public function updatedwebhookEndpoint() {
$this->teams_webhook_deprecated = !Str::contains($this->webhook_endpoint, 'workflows');
}
private function isButtonDisabled() {