jenkins-pipelineparameterizedjenkins-declarative-pipeline

ParameterizedCron triggers multiple jobs in a declarative pipeline


I am trying to run multiple test lists using the Parameterized Scheduler inside a scripted pipeline.

The cron works fine for the 2.30pm and triggers list_id=163, but at 3pm it triggers both list_id=119 and list_id=163 . Any suggestions on how to tackle this, or am I missing a parameter ?
Thank you

properties([parameters([
         string(name: 'TEST_LIST_ID', defaultValue: '163', description: 'Feature test 1'),
         string(name: 'TEST_LIST_ID', defaultValue: '119', description: 'Feature test 2')
]),
pipelineTriggers([parameterizedCron('''
                   H/30 14 * * 1-5 %TEST_LIST_ID=163
                   H 15 * * 1-5 %TEST_LIST_ID=119
                   ''')])

Blockquote


Solution

  • Update: I was able to solve the issue of multiple triggers by spacing out the cron time and also by using changing the order of the crons For eg: My jenkinsfile has 12 crons, so I ordered the crons in decreasing order of time while also making sure there is enough time between subsequent jobs.