Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mentions not working, behave like a string #405

Open
Vanals opened this issue May 2, 2023 · 7 comments
Open

Mentions not working, behave like a string #405

Vanals opened this issue May 2, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@Vanals
Copy link

Vanals commented May 2, 2023

Orb version: circleci/slack@4.10.1

What happened:

I am adding the orb for slack notification in a second project own by my team, In the first project it works perfectly, in the second one the slack message is triggered but the mention is simply a string.

slack_notify: &slack_notify
  event: 'fail'
  channel: '#newskit-all-team'
  mentions: '@newskitdevs'
  branch_pattern: 'main'

I am tagging exactly the same group as in the other project, both orb versions are the same, but for some reason the mention is not correct. I have read that you suggest using a UserID, but in my case this is not a user but a slack group.

WHAT HAPPENS ON THE SECOND PROJECT:

Screenshot 2023-05-02 at 12 21 32

FIRST PROJECT, WHERE WORKS CORRECTLY.
Screenshot 2023-05-02 at 12 24 03

EDIT: WHAT I HAVE ALSO TRIED

I have even tried with GroupID but doesn't work

slack_notify: &slack_notify
  event: 'fail'
  channel: '#newskit-themes'
  mentions: '<@SUV69PHB2>'

Screenshot 2023-05-02 at 13 44 49

Also tried using the latest version 4.12.3, but still doesn't work

UPDATE: 🔆🔆🔆🔆

I haven't been able to fix it, but we think the reason for the issue is that the Slack channel is shared between workspaces, so the groups I was trying to tag, not existing in both workspaces, were being printed as a string also where it existed. This is at least what we think, but we can't be sure.

May leave it open in case anyone has another idea or solution. Otherwise close it 👍

Expected behavior:

Mentions should notify the group, being clickable, and not be a string

@Vanals Vanals added the bug Something isn't working label May 2, 2023
@Vanals
Copy link
Author

Vanals commented May 9, 2023

I haven't been able to fix it, but we think the reason for the issue is that the Slack channel is shared between workspaces, so the groups I was trying to tag, not existing in both workspaces, were being printed as a string also where it existed. This is at least what we think, but we can't be sure.

May leave it open in case anyone has another idea or solution. Otherwise close it 👍

@h-parekh
Copy link

h-parekh commented Jun 29, 2023

Can confirm this is an issue with slack: circleci/slack@4.12.5. Fails to mention myself (versus a slack group). Using slack user ID as a workaround for now.

@CentroDL
Copy link

CentroDL commented Sep 27, 2023

I'm on 4.12.5, the following config works for mentions in the success template, but the fail template loses the Slack user id passed in as the mention:

image

Yielding the following messages:

image

@KyleTryon
Copy link
Contributor

Hey @Vanals, I have seen this happen before, but I'm not fully sure what causes it. What I can say, is it should work if rather than their name, you use their ID:
https://circleci.com/developer/orbs/orb/circleci/slack#usage-only_notify_on_branch

     - slack/notify:
          branch_pattern: production
          event: fail
          mentions: <@U8XXXXXXX>, @UserName
          template: basic_fail_1

You can get a users ID from their profile, click the three dots and it will have a menu item to copy it.

@Navusas
Copy link

Navusas commented Nov 2, 2023

Same problem here.

Tried:

      - slack/on-hold:
          mentions: <@S0S4XXXXH>
          context: ....

and

      - slack/on-hold:
          mentions: @TeamName
          context: ....

and

      - slack/on-hold:
          mentions: '<@S0S4XXXXH>'
          context: ....

Nothing works. The end result is the same:
image

@marboledacci
Copy link
Contributor

Do these mentions work when you use them manually in the target slack channel?

@Navusas
Copy link

Navusas commented Sep 18, 2024

Sorry this is no longer relevant to me and I can't test it anymore. Others might still have some input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants