-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
Jenkins 2.153
Slack Plugin 2.4
Job DSL 1.70
We use Jenkins DSL to manage our jobs configuration. Some of the jobs have Slack Plugin configured with the custom message. It stopped work with the Slack Plugin 2.4 - includeCustomMessage property doesn't do anything at all.
Take a look at this DSL configuration:
def userMessage = "@emil"job("slack-try"){ publishers { slackNotifier { authToken('') baseUrl('') botUser(false) commitInfoChoice('NONE') includeCustomMessage(true) includeTestSummary(false) notifyAborted(false) notifyBackToNormal(true) customMessage(userMessage) notifyFailure(true) notifyNotBuilt(false) notifyRegression(false) notifyRepeatedFailure(true) notifySuccess(false) notifyUnstable(false) room('') tokenCredentialId('') sendAs('') startNotification(false) teamDomain('') } } }
It should generate a job with Slack Notifier and WITH Custom Message checked. And in the created XML file includeCustomMessage is set to true:
<?xml version="1.0" encoding="UTF-8"?><project> <actions/> <description/> <keepDependencies>false</keepDependencies> <properties/> <scm class="hudson.scm.NullSCM"/> <canRoam>true</canRoam> <disabled>false</disabled> <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding> <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> <triggers/> <concurrentBuild>false</concurrentBuild> <builders/> <publishers> <jenkins.plugins.slack.SlackNotifier plugin="slack@2.4"> <baseUrl/> <teamDomain/> <authToken/> <tokenCredentialId/> <botUser>false</botUser> <room/> <sendAs/> <startNotification>false</startNotification> <notifySuccess>false</notifySuccess> <notifyAborted>false</notifyAborted> <notifyNotBuilt>false</notifyNotBuilt> <notifyUnstable>false</notifyUnstable> <notifyRegression>false</notifyRegression> <notifyFailure>true</notifyFailure> <notifyBackToNormal>true</notifyBackToNormal> <notifyRepeatedFailure>true</notifyRepeatedFailure> <includeTestSummary>false</includeTestSummary> <includeFailedTests>false</includeFailedTests> <commitInfoChoice>NONE</commitInfoChoice> <includeCustomMessage>true</includeCustomMessage> <customMessage>@emil</customMessage> </jenkins.plugins.slack.SlackNotifier> </publishers> <buildWrappers/> </project>
But in the GUI Include Custom Message checkbox is not marked:
This functionality works perfectly with Slack Plugin 2.3. For us, it's very annoying, so we decided to downgrade the plugin, and rollback configuration (in 2.4 there are new properties like baseUrl or tokenCredentialId).