Jenkins downstream pipeline jobs not always triggered as expected I have three separate Multibranch pipeline jobs set up on Jenkins, which I want to be called sequentially as downstream-jobs. Please note that, all these 3 jobs have separate git repositories!
Each job has its own Jenkinsfile.
The first job is always triggered manually by me through the Jenkins UI. At the last stage of the 1st job's Jenkinsfile, the second job is being triggered, as shown below. (The second job triggers the third job, in the same way)
stage('Trigger second job')
{
   steps {
       build job: 'second_job_name', propagate: true, wait: false
   }
}

Now this step always seems to be executed successfully when the first job ends, no errors or warnings show up on the logs. This should mean that the second downstream job has been called, but unfortunately that's not always the case:

Sometimes the first job triggers the second job, but the second job never actually triggers the third one, although it seems to pass the corresponding Jenkinsfile stage.
Sometimes the first job completes but never triggers the second job at all.

The only time this setup works as expected, is when there are new commits to all 3 git repos. Then all 3 jobs are triggered sequentially without issues.
Does anyone know the reason behind this inconsistent behavior?
Is it maybe because the jobs are based on different git repos?
Is there anything I can do to fix this?
Thanks
I suspect this job name is the issue:
build job: 'second_job_name'

In a Multibranch pipeline, there are typically folders in the job name.  For instance, if you have a Multibranch project named &quot;my_project&quot;, a repo in that project named &quot;my_repo&quot;, and a branch within that repo that you wish to build, let's say &quot;master&quot;, then your build command would look like:
build job: 'my_project/my_repo/master'

If you only specify up to the project or repo level in your job name, but don't include the branch, instead of running a build for the branch, Jenkins will scan for updates to all branches within that project/repo, and build any new commits which it hasn't yet built.  This results in exactly the symptoms you described:

The only time this setup works as expected, is when there are new commits to all 3 git repos. Then all 3 jobs are triggered sequentially without issues.