Skip to content

Commit

Permalink
Fix duplicate messages issues in gitlab_slack_notifier.py (demisto#34057
Browse files Browse the repository at this point in the history
)

* validate slack_msg is not empty

* add text param to chat_postMessage
  • Loading branch information
adi88d authored Apr 24, 2024
1 parent 7314752 commit 8b1a15e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Tests/scripts/gitlab_slack_notifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ def main():
for channel in channels_to_send_msg(computed_slack_channel):
try:
response = slack_client.chat_postMessage(
channel=channel, attachments=slack_msg_data, username=SLACK_USERNAME, link_names=True
channel=channel, attachments=slack_msg_data, username=SLACK_USERNAME, link_names=True, text=""
)

if threaded_messages:
Expand All @@ -712,7 +712,7 @@ def main():
slack_msg = [slack_msg] if not isinstance(slack_msg, list) else slack_msg
slack_client.chat_postMessage(
channel=channel, attachments=slack_msg, username=SLACK_USERNAME,
thread_ts=thread_ts
thread_ts=thread_ts, text=""
)

link = build_link_to_message(response)
Expand Down

0 comments on commit 8b1a15e

Please sign in to comment.