jenkinsjenkins-api

How to get the project status of a Jenkins multi-branch project?


It is possible to disable a multi-branch pipeline with:

It is possible enable a multi-branch pipeline with:

But I haven't found any API to get the actual status.

The following URL do not show any difference between a disabled/enabled multi-branch project:

And the following URL do not show this famous "color" (= status) field for multi-branch project:

Also, I can have the status of ONE branch, but this status is incorrect: when I disable the multi-branch project, and call this URL:

=> It returns the field "buildable" at true

How to retrieve the status we are able to change of the multi-branch project ?


Solution

  • There seems to be no Jobs API for multi branch pipelines that reports correctly status of the job disabled/enabled.

    You can obtain this info from the job's config.xml:
    https://jenkins.domain.com/job/Multibranch-Job-Name/config.xml
    <disabled>true</disabled>