Skip to content

Watcher Slack action fails to send direct message when configured with the username  #104424

Open
@naj-h

Description

@naj-h

Elasticsearch Version

7.17.11

Installed Plugins

No response

Java Version

bundled

OS Version

N/A

Problem Description

The watcher documentation indicates that in the message.to attribute:

Channel names must start with # and user names must start with @.

While this used to work before, Slack has deprecated passing "username" as a channel value.

I have tested this in a cluster on 7.17.11, the Slack action failed when message.to is filled with a username like @username, the error was channel_not_found. But it worked when providing it with just my member ID.

      "slack": {
        "message": {
          "to": [
            "U98DI989YE9"
          ],

(this is a dummy user id)

This is how I got my own member ID from Slack UI
297136746-476b17a5-8118-4d7b-a392-a552cb31e4dd

If we confirm this, the the watcher documentation needs to be updated to match the latest

Steps to Reproduce

  • Create a watch with a Slack action
  • In message.to field, enter a username prefixed with @
  • Save the watch and simulate or execute it
  • Notice the failed Slack action

Logs (if relevant)

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions