How to disable Multibranch / Organization project ?

Issue

  • I would like to disable a Multibranch item so that no underlying job can be triggered
  • I would like to disable a Organization item so that no underlying job can be triggered

Environment

Related Issue

Explanation

Since the release of Folders plugin 6.1.0 and Branch API 2.0.11, there is an API to disable Computer Folders such as Multibranch and Organization items. The API uses a QueueDecisionHandler that prevents scheduling builds from any job that is descendant of a disabled computed folder. This applies to any type of trigger, whether it originates from a branch indexing event, an SCM event or even a manual trigger.

Resolution

The UI controls to disable and enable Multibranch / Organization items have been fixed in Folders Plugin 6.12 as per JENKINS-60900.

Since Folders Plugin 6.12, you’ll be able to enable and disable them by clicking on the Disable Multibranch Pipeline or the corresponding item button.

Workaround

If it’s not possible for you doing an immediate upgrade of the folder plugins, you can temporarily workaround it following one of the options below:

  1. Append /disable and /enable to the URL of the Multibranch / Organization and then hit “Retry Using POST”.
  2. Run the following code on the Script console:
Jenkins.get().getItemByFullName("PATH/TO/YOURMULTIBRANCH").doEnable() //To enable the item
Jenkins.get().getItemByFullName("PATH/TO/YOURMULTIBRANCH").doDisable() //To disable the item

With both of the options above, the disabled item will displayed a greyed out icon.

Have more questions?

0 Comments

Please sign in to leave a comment.