Issue
Hey i've been trying to send message with my number of build in a slack message in my jenkins pipeline using slacksend like this
slackSend channel: 'developer-team', message: 'The unit tests have been successful for Build N°: ${currentBuild.number}'
but the message i get from slack is this way :
The unit tests have been successful for Build N°: ${currentBuild.number}
i don't know how to fix to get the appropriate message
Solution
Try like this:
slackSend channel: '#notification', color: 'good', message: "The unit tests have been successful for Build N°: ${env.BUILD_NUMBER}", teamDomain: 'testnotifgroup', tokenCredentialId: 'slack-token'
Use double quotes " " to wrap your message
Answered By - Sourav Atta
Answer Checked By - David Goodson (JavaFixing Volunteer)