title: Is it possible to pass a template with a list of jobs to a jobList type param?
body: <p>Currently in Azure pipelines, we can pass the list of jobs to be executed to a child template with a parameter of <code>jobList</code> type as shown in the doco.</p>
  <p><a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops#iterative-insertion" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops#iterative-insertion</a></p>
  <p>Is there a way I can encapsulate these jobs from pipeline.yml that are being passed to the <code>jobList</code> param inside another job template and pass that template to a <code>jobList</code> param. I tried to structure my pipeline as follows:</p>
  <pre><code>pipeline.yml
  deployment-template.yml
  post-deploy-tests-dev.yml
  post-deploy-smoke-tests-prod.yml
  </code></pre>
  <p>I would like to dynamically insert different tests' jobs to the end of the <code>deployment template</code> depending on the environment. I tried the <code>jobList</code> type parameter in the <code>deployment-template.yml</code> as the following but it throws an error saying <code>mapping not expected</code>.</p>
  <pre><code>#post-deploy-tests-dev.yml
  jobs:
      - job: Test1
        steps:
        - script: execute test1
  
  #post-deploy-tests-smoke-tests-prod.yml
  jobs:
      - job: Test2
        steps:
        - script: execute test2
  
  #pipeline.yml
  ...
  - template: deployment-template.yml
    parameters:
      environment: dev
      testsJobsList: 
        template: post-deploy-tests-dev.yml
  - template: deployment-template.yml
    parameters:
      environment: prod
      testsJobsList: 
        template: post-deploy-smoke-tests-prod.yml
  
  #deployment-template.yml
  parameters:
    - name: testsJobsList
      type: jobList
      default: []
  #All deployment jobs here
  jobs:
  ...
  ...
  #Tests as the end
    - ${{ parameters.testsJobsList }}
  </code></pre>
  <p>Is there a way to dynamically pass the <code>jobList</code> ?</p>