Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,363,998
Community Members
 
Community Events
168
Community Groups

How can I mention someone using slack notification from bitbucket pipeline

Edited
how to send slack notification mentioning someone?

 -
step:
        name: Send Notification to Slack
        script:
          - pipe: atlassian/slack-notify:2.0.0
            variables:
              WEBHOOK_URL: 'CLASSIFIED'
              MESSAGE: '$(cat error_message.txt; printf [CLASSIFIED/$(cat folder_name.txt)/index.html] @[Someone]'

1 answer

1 accepted

2 votes
Answer accepted
Syahrul Atlassian Team Sep 05, 2022

Hey @John Michael Flores 

Welcome to the community!

I did some search and found that you'll need to use 'memberID' when you want to mention someone from the Slack webhook.

For example, I have a user name Syahrul with 'memberID' of 'U88271KS', I'll pass this in the message as the following example:

          script:
            - echo "Notify someone in Slack"
            - pipe: atlassian/slack-notify:2.0.0
              variables:
                  WEBHOOK_URL: '<Webhook>'
                  MESSAGE: 'Hey <@U88271KS>' 

This create @Syahrul notification in my Slack test channel as expected. You can check the guide  here to find the Slack 'memberID'.

Cheers,
Syahrul

Thanks for the answer, how can I BOLD the message?

Syahrul Atlassian Team Sep 07, 2022

Hey @John Michael Flores 

If you looking into formatting your Slack message, I would suggest you check the Slack API formatting page below:

https://api.slack.com/reference/surfaces/formatting#visual-styles

That said, you can use *BOLD* in your message to bold a text message.

Cheers,
Syahrul

Like John Michael Flores likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS

Atlassian Community Events