I am new to Groovy DSL, I am getting a list of successful jenkins job names from a script which satisfies my condition which will vary on each execution, EX1: JOB_A,JOB_B.. EX2: JOB_C,JOB_Y...I need to trigger these result list of jobs at the time of execution of the script sequentially in a for loop from Script console using Groovy script. How can i achieve this?
Asked
Active
Viewed 670 times
0
-
Do you really need to execute it in the Script console? Most things are a lot easier in a pipeline. – smelm Oct 01 '19 at 07:57
1 Answers
0
If you are in a pipeline you can use
jobList.each{ jobName ->
build: jobName
}

smelm
- 1,253
- 7
- 14
-
I am not executing in a pipeline i am running these through script console. Can you please help me understand your logic. – Karthik Reddy Oct 03 '19 at 03:23
-
If you want to execute a script on a regular basis, it's a lot easier to write a pipeline than using the script console every time – smelm Oct 04 '19 at 11:36
-
Ok but how do we trigger other builds without providing the authentication token? – Karthik Reddy Oct 09 '19 at 03:41