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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


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
Community Members
Community Events
Community Groups

email notification with artifacts


Can anyone please tell me how to configure the email notifications for every build "Success/Failure", If build is "Success" need the "Artifacts" to be attached with email as well.

few examples are there, a step by step implementation will be more helpful.



1 answer

1 vote
Patrik S Atlassian Team May 19, 2022

Hello @PrasanthK ,

Welcome to Atlassian Community!

You could configure an after-script section in your step combined with the pipe atlassian/email-notify to send an e-mail with the status of the build and also with the artifacts attached.

The after-script section is always executed independently if the commands in the step have failed or not.

Please allow me to share a configuration example using Gmail's SMTP:




- step:


- echo "This is test command 1" > file1.txt

- echo "This is test command 2" > file2.txt


- ALERT_TYPE="success"

- if [[ $BITBUCKET_EXIT_CODE -ne 0 ]]; then ALERT_TYPE="error" ; fi

- pipe: atlassian/email-notify:0.7.0




FROM: ''

TO: ''

HOST: ''

SUBJECT: '${ALERT_TYPE}:Bitbucket Pipe Notification for ${BITBUCKET_BRANCH}'

ATTACHMENTS: 'file1.txt,file2.txt'


The example above creates two text files (file1.txt and file2.txt) in the default directory as part of the step's script. The after-script section will check the value of $BITBUCKET_EXIT_CODE to define if the commands executed in the step were successful or not ( 0 exit code equals success). Then it will send an e-mail with the status of the build - 'success' or 'error' - and the created files attached, accordingly to the values configured in the variable section of atlassian/email-notify pipe.

You can adapt the above example with your current e-mail provider. For detailed instructions on how to configure the pipe, you can refer to its official documentation :

This documentation also provides links to the most common providers and how you should configure them.

Hope that helps! In case you have any further questions related to this topic, please let me know.

Thank you, @PrasanthK .

Kind regards,

Patrik S

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events