Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-55015

Include Custom Message has stopped work with DSL

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • slack-plugin
    • None
    • Jenkins 2.153
      Slack Plugin 2.4
      Job DSL 1.70

    Description

      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).

      Attachments

        Activity

          Seeing the same problem using Freestyle projects, but I do not have Job DSL plugin installed.
          Environment: 
          Jenkins 2.153 
          Slack Plugin 2.4

          silvermo Marcis Liepins added a comment - Seeing the same problem using Freestyle projects, but I do not have Job DSL plugin installed. Environment:  Jenkins 2.153  Slack Plugin 2.4
          ewypych Emil Wypych added a comment -

          Seems it has been fixed in 2.6 – silvermo could you please confirm?

          ewypych Emil Wypych added a comment - Seems it has been fixed in 2.6 – silvermo could you please confirm?
          silvermo Marcis Liepins added a comment - - edited

          ewypych Slack Plugin 2.6 working on Jenkins 2.155

          silvermo Marcis Liepins added a comment - - edited ewypych  Slack Plugin 2.6 working on Jenkins 2.155

          People

            kmadel Kurt Madel
            ewypych Emil Wypych
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: