In Jenkins, if Job A triggers Job B after it finishes successfully, which statement is true?
Think about the direction of the trigger: who starts first and who follows.
In Jenkins, the job that triggers another is called the upstream job, and the job that is triggered is the downstream job. Since Job A triggers Job B, Job A is upstream and Job B is downstream.
What will be the output of this Jenkins pipeline snippet when Job A triggers Job B?
pipeline {
agent any
stages {
stage('Trigger') {
steps {
build job: 'JobB', wait: true
echo 'Job B completed'
}
}
}
}Check the meaning of wait: true in the build step.
The build step with wait: true waits for Job B to finish before continuing. So the echo runs after Job B completes.
Which Jenkins pipeline snippet correctly triggers two downstream jobs JobB and JobC in parallel and waits for both to finish?
pipeline {
agent any
stages {
stage('Trigger') {
steps {
parallel {
JobB: { build job: 'JobB', wait: true },
JobC: { build job: 'JobC', wait: true }
}
}
}
}
}Remember that parallel runs branches at the same time and wait: true waits for each job to finish.
Option B uses parallel with wait: true for both jobs, so both run simultaneously and the pipeline waits for both to finish before continuing.
You have configured Job A to trigger Job B using the build step in a pipeline, but Job B never starts. What is the most likely cause?
Check if the downstream job is available and enabled.
If Job B is disabled or does not exist, Jenkins cannot trigger it. Missing wait: true does not prevent triggering. Job B can be triggered multiple times unless restricted.
You want Job A to start only after Job B completes successfully, but Job B is not triggered by Job A. Which Jenkins feature best supports this?
Think about how to start a job after another finishes when the first job is not triggered by the second.
Configuring Job B to trigger Job A on success ensures Job A runs only after Job B completes. Polling or timers are less efficient and more error-prone.