How to change slack notification in jenkins? How to change slack notification in jenkins? jenkins jenkins

How to change slack notification in jenkins?


If you use jenkins 2.0 you can change massage something like this:

slackSend color: 'good', message: 'Message from Jenkins Pipeline'

Or something like this in UI

enter image description here


You can use Jenkinsfile and every configuration will be in your vcs.

node {    try {        notifyStarted()        stage 'Checkout'        sh gg        stage 'Build'        sh xx        stage 'Deploy'        sh yy        notifySuccessful()    } catch(e) {        currentBuild.result = "FAILED"        notifyFailed()    }}def notifyStarted() {    slackSend (color: '#FFFF00', message: "STARTED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")}def notifySuccessful() {    slackSend (color: '#00FF00', message: "SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")}def notifyFailed() {  slackSend (color: '#FF0000', message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")}