Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Adding Slack webhook CURL command in bitbucket pipeline

I am planning to add a command to my bitbucket pipeline.

curl -X POST -H 'Content-type: application/json' --data '{"text":"Allow me to reintroduce myself!"}' YOUR_WEBHOOK_URL

How do I do that, if I add this line it shows an error,  guide me with correct steps for this.

2 answers

1 accepted

0 votes
Answer accepted

Hi @Ajay Maurya ,

Thank you for your question!

It's a good case to use slack-notify pipe.

script:
  - pipe: atlassian/slack-notify:0.3.5
    variables:
      WEBHOOK_URL: $WEBHOOK_URL
      MESSAGE: 'Allow me to reintroduce myself!'


More useful pipes you can discover on the Bitbucket Pipes Marketplace.

Cheer,
Alex

Hi @Oleksandr Kyrdan  

Thanks for the help.  
I ended applying the same thing which you mentioned https://bitbucket.org/atlassian/slack-notify/src/master/

I am glad I did it the correct way.
Thanks once again.

1 vote
Daniel Eads Atlassian Team May 08, 2020

Hi Ajay, welcome to the Community!

I can see this curl command matches what's in Slack's 'hello world' tutorial. There are some prerequisites to sending a notification like this in the guide; an app already needs to be set up in your Slack instance to generate a webhook URL and connect it to a channel.

Are you able to run this curl command locally and receive the message in Slack?

If so, can you post the error you're receiving from the pipeline?

Thanks,
Daniel

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Admins, notify your Jira instance of system-wide changes with the new admin announcement banner

Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across Jira Cloud instance.   📢 Get y...

122 views 6 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you