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

GString not supported by automatically generated DSL

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • job-dsl-plugin
    • None

      The following script will cause an error because of the GString argument to room

      def SLACK_CHANNEL = 'bar'
      
      job('example') {
        publishers {
          slackNotifier {
            room("foo-${SLACK_CHANNEL}")
            notifyAborted(true)
            notifyFailure(true)
            notifyNotBuilt(false)
            notifyUnstable(true)
            notifyBackToNormal(true)
            notifySuccess(false)
            notifyRepeatedFailure(false)
            startNotification(false)
            includeTestSummary(false)
            includeCustomMessage(false)
            customMessage(null)
            buildServerUrl(null)
            sendAs(null)
            commitInfoChoice('NONE')
            teamDomain(null)
            authToken(null)
          }
        }
      }
      

      console log:

      Processing provided DSL script
      ERROR: (script, line 6) No signature of method: javaposse.jobdsl.plugin.structs.DescribableContext.room() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl) values: [foo-bar]
      Possible solutions: wait(), dump(), any(), find(), grep(), wait(long)
      Finished: FAILURE
      

            daspilker Daniel Spilker
            daspilker Daniel Spilker
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: