I have a groovy slacksend function to notify to slack channels.
slackSend(
channel: "#channel-name",
color: "warning",
message: "Could not confirm server started - ${env.BRANCH} (<${env.BUILD_URL}/console|Details> - <${SERVER_URL}|Open>)"
)
But the output is something like this
[Pipeline] slackSend
run slackstepsend, step null:false, desc :true
Slack Send Pipeline step configured values from global config - baseUrl:
true, teamDomain: true, token: true, channel: false, color: false
and there is not notification being sent. Any idea?
Those values in your pipeline output should be getting populated with the values from your jenkinsfile. eg, teamDomain: true
should be teamDomain: <your_slack_team>
. You can pass each of these as a parameter in the slacksend invocation in your Jenkinsfile just as you are with channel, color, and message. Also, your channel name doesn't require #
, though i don't know if that would cause it to fail.
slackSend channel: '#yourchannelname', color: color, message: 'Starting branch', teamDomain: 'your_enterprise_team_domain', token: 'token_generated_from_jenkins_slack_integration'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With