0

Is it possible to pass parameters as a string, something like below?

properties([
cronStr = "/3 * * * *"
pipelineTriggers([cron(cronStr)]),
])
Roman Patutin
  • 2,171
  • 4
  • 23
  • 27
keyshow
  • 1
  • 2
  • Does this answer your question? [How to setup a multiline parametrized cron job in Jenkins Scripted Pipeline?](https://stackoverflow.com/questions/57789810/how-to-setup-a-multiline-parametrized-cron-job-in-jenkins-scripted-pipeline) – K. B. Dec 13 '20 at 08:11

1 Answers1

0

Thanks @K.B., the below worked for me. Issue with scope of the variable.

def cronStr = "/3 * * * *" 
properties([ 
pipelineTriggers([cron(cronStr)]), 
]) 
keyshow
  • 1
  • 2