cloudfoundry-community / slack-notification-resource

Concourse CI resource for sending notifications to Slack.
MIT License
75 stars 82 forks source link

Mentions do not seem to work #44

Closed ollema closed 6 years ago

ollema commented 6 years ago

Hi!

I'm trying to mention myself in slack messages sent. This do not seem to work for some reason. I've tried to different syntaxes, as suggested by: https://github.com/cloudfoundry-community/slack-notification-resource/issues/16

Maybe that only applies to <!here> and not <!username>?

Here's a super simple pipeline to reproduce the issue. Replace the username (unless your are also named olle) and the ((slack_webhook)) with your own unless you already happen to have that stored in a credential manager 😄

resource_types:
- name: slack-notification
  type: docker-image
  source:
    repository: cfcommunity/slack-notification-resource
    tag: latest
resources:
- name: slack
  type: slack-notification
  source:
    url: ((slack_webhook))
jobs:
- name: hello-world
  plan:
  - get: slack
  on_success:
    do:
    - put: slack
      params:
        text: "<!olle> *$BUILD_PIPELINE_NAME/$BUILD_JOB_NAME* succeded!"
    - put: slack
      params:
        text: "@olle *$BUILD_PIPELINE_NAME/$BUILD_JOB_NAME* succeded!"

Output in slack:

screen shot 2018-02-13 at 15 00 08
ollema commented 6 years ago

ugh. this is a slack thing, not a slack-notification-resource thing.

for future users trying to tag users instead of things like <!here>, you need your slack user ID (<@U123>): https://api.slack.com/changelog/2017-09-the-one-about-usernames#undocumented_mentions

sorry bout this!