Complete the code to send a Slack notification in a Jenkins pipeline.
slackSend channel: '#general', message: 'Build completed successfully', [1]
The color: 'good' option sends a green notification indicating success.
Complete the code to notify Slack only when the build fails.
post {
failure {
slackSend channel: '#alerts', message: 'Build failed!', [1]
}
}The color: 'danger' option sends a red notification indicating failure.
Fix the error in the Slack notification code to include the correct channel name.
slackSend channel: [1], message: 'Deployment started', color: 'warning'
The channel name must start with '#' to specify the Slack channel correctly.
Fill both blanks to send a Slack notification with a custom message and color.
slackSend channel: [1], message: [2], color: 'warning'
The channel is '#devops' and the message is 'Build failed!' with a warning color.
Fill all three blanks to send a Slack notification with uppercase channel, dynamic message, and success color.
slackSend channel: [1], message: [2], color: [3]
The channel is '#OPS' in uppercase, the message is dynamic, and the color 'good' means success.