Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-72958

Expose if a multi-branch pipeline branch job is default/primary to REST API

XMLWordPrintable

      A WorkflowJob should expose a variable in the REST API to indicate if it is a default/primary branch.

      The scm api plugin contains a PrimaryInstanceMetadataAction which is used to indicate if a git branch is the default branch. The workflow-multibranch-plugin is aware of this and uses it to mark the text in the table as strong here. It also shows up in the config.xml of the branch job:

      <actions>
      <jenkins.scm.api.metadata.PrimaryInstanceMetadataAction plugin="scm-api@676.v886669a_199a_a_"/>
      </actions>
      

      Currently this information can be obtained by loading the config.xml individually for each job. By exposing it to the REST API it can be loaded for multiple jobs at once if desired using the proper tree expression.

            Unassigned Unassigned
            mrichar2 Mark R
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: