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

triggers is deprecated -> UNSTABLE build

    Details

    • Similar Issues:

      Description

      Hi,

      I am getting the warning:

      Warning: (xxxxxxxxxxx.groovy, line NNN) triggers is deprecated

      that exists as an UNSTABLE build,

       

      whereas I am using the new syntax for pipelineJob creation:

       

        properties {
              disableConcurrentBuilds()
              if(params.triggers != null && params.triggers.cron != null) {
                  triggers {
                    pipelineTriggers {
                      triggers {
                          cron {
                              spec(params.triggers.cron)
                          }
                      }
                   }
                 }
              }
      

      regards,

       

       

       

        Attachments

          Issue Links

            Activity

            Hide
            daspilker Daniel Spilker added a comment -

            There is no `triggers` in `properties`. In this case Groovy will search the outer contexts for a method with the same name and finds the deprecated one in `pipelineJob`.

            pipelineJob('example') {
              properties {
                disableConcurrentBuilds()
                if(params.triggers != null && params.triggers.cron != null) {
                  pipelineTriggers {
                    triggers {
                      cron {
                        spec(params.triggers.cron)
                      }
                    }
                  }
                }
              }
            }
            Show
            daspilker Daniel Spilker added a comment - There is no `triggers` in `properties`. In this case Groovy will search the outer contexts for a method with the same name and finds the deprecated one in `pipelineJob`. pipelineJob( 'example' ) { properties { disableConcurrentBuilds() if (params.triggers != null && params.triggers.cron != null ) { pipelineTriggers { triggers { cron { spec(params.triggers.cron) } } } } } }

              People

              • Assignee:
                based3 Basile Chandesris
                Reporter:
                based3 Basile Chandesris
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: