Triggering one pipeline after another pipeline finishes in the same project

New Contributor

We have a pipeline that we want to trigger after another pipeline finishes from the "development" branch

resources:

  pipelines:
  - pipelineDatabaseIncentives 
    sourceDatabase.Incentives_TestData 
    trigger
      branches:
        include
        - development

When I save this change and then go trigger a Database.Incentives_TestData pipeline to run and it completes,   The pipeline with the above resource does not automatically trigger.

what might I be doing wrong?
2 Replies

How does the pipeline DatabaseIncentives that I just added the resource too, know that it should trigger after the Database.Incentives_TestData pipeline has finished? The yaml file is just a text file checked in with the resource added. Does the pipeline name " - pipeline: DatabaseIncentives " have to match the pipeline name that this resource is placed in?

resources: 
  repositories: 
  - repository: yamltemplates
    type: git
    name: Onlife/yamltemplates
  - repository: build_scripts
    type: git
    name: Onlife/devops_build
  pipelines:
  - pipeline: DatabaseIncentives 
    source: Database.Incentives_TestData 
    trigger: 
      branches:
        include: 
        - development
I was able to get this to work using the UI, picking triggers and setting a build completion trigger. I could not do it with just yaml files alone.