Skip to content

Commit

Permalink
only show Correlation context element if there are entiites in message (
Browse files Browse the repository at this point in the history
Netflix#3100) (#82)

Co-authored-by: Will Sheldon <114631109+wssheldon@users.noreply.github.com>
  • Loading branch information
rutvijmehta-harness and wssheldon authored Mar 17, 2023
1 parent b1f05e4 commit e29df11
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/dispatch/plugins/dispatch_slack/case/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,10 @@ def create_signal_messages(case: Case, channel_id: str, db_session: Session) ->
)
signal_metadata_blocks.append(Divider())

signal_metadata_blocks.append(
Context(elements=["Correlation is based on two weeks of signal data."]),
)
if instance.entities:
signal_metadata_blocks.append(
Context(elements=["Correlation is based on two weeks of signal data."]),
)

messages.append(Message(blocks=signal_metadata_blocks[:50]).build()["blocks"])
return messages

0 comments on commit e29df11

Please sign in to comment.