Does this work if you put it inside a stage{steps{script{}}}? Properties are not supported like that in Declarative (as it say), but you may be able to just run it in the script (basically dropping out of declarative).
On Tuesday, October 24, 2017 at 7:32:10 AM UTC-6, Andy Coates wrote: > > Hey, > > I keep seeing reference to a properties function like this: > > properties([ pipelineTriggers([ [$class: "GitHubPushTrigger"] ]) ]) > > The description and functionality appears to do what the UI option "GitHub > hook trigger for GITScm polling" does. > > Unfortunately this doesn't seem to exist in the current declarative > pipeline at a top level config. > > If I look at https://jenkins.io/doc/pipeline/steps/workflow-multibranch/ > (since I'm working with multibranch) it has a 'properties' step section, > and in Jenkins the Pipeline Syntax generator for 'properties' step gives me > an example of: > > properties([[$class: 'GithubProjectProperty', displayName: '', > projectUrlStr: 'https://github.com/foo/bar/'], > pipelineTriggers([githubPush()])]) > > However the documentation and that syntax generator appear to generate a > step that doesn't exist - Jenkins throws an error: > > WorkflowScript: 30: Invalid step "properties" used - not allowed in this > context - The properties step cannot be used in Declarative Pipelines > > > I feel like I'm going around in circles here :( Help! > > Thanks. > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/f386142a-fe91-4979-a707-6348a1bbb4dc%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.