How to add custom message to slack with variable in Jenkins? How to add custom message to slack with variable in Jenkins? jenkins jenkins

How to add custom message to slack with variable in Jenkins?


You can do this:

slackSend channel: 'channel_name', message: 'My_Job - ' + BUILD_NUMBER + '\nMy_Report:' + JENKINS_URL


Environment variables are acessible for building custom slack notifications. In my case I'm using variables from GitLab webhooks configured to trigger builds to customize slack messages:

So this message definition:

enter image description here

Results in this slack notification:

enter image description here