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

how to send custom variables to a Slack Webhook?

Hello,

I have a slack webhook that receives as a parameter an attribute,

example: { "text": "Build success"}

how can I send this variable using bitbucket pipeline?

They do not mention that point in the official documentation

https://bitbucket.org/atlassian/slack-notify/src/master/

Error: 

Captura de Pantalla 2021-06-23 a la(s) 03.14.50.png

 

Pipeline file:

Captura de Pantalla 2021-06-23 a la(s) 03.16.03.png

1 answer

0 votes

@jamerquiroga we are sending  'text' field  on our own, so I guess you should specify as MESSAGE variable 'build success'.

This is actually strange, your pipeline looks valid. I tried this and succeeded in the case if $build_status var in pipeline has string type. Like $build_status=success or $build_status = 0.

But pipeline says the MESSAGE (text) is empty. Check if you have passed MESSAGE in the last execution indeed, because failure message does not correspond to what you have in pipeline shared.

Try also to go with MESSAGE: '"your message $build_status"'  (find this in readme as advanced example https://bitbucket.org/atlassian/slack-notify/src/master/).

^^ This will help us to understand the root cause, because for now, I don't see why pipeline would fail.

Regards, Galyna

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

Bitbucket Pipelines Runners is now in open beta

We are excited to announce the open beta program for self-hosted runners. Bitbucket Pipelines Runners is available to everyone. Please try it and let us know your feedback. If you have any issue...

3,861 views 68 21
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