I am using pipeline jobs with Jenkins 2.0, but I don't see option 'disable job' as I was used to in older Jenkins versions. Am I missing something? Is it still possible to disable (pipeline) job?
-
As far as I know based on looking through the source code, there is no disable function support. But hopefully get confirmed from some other people. – Tim Aug 05 '16 at 10:37
8 Answers
You can simply use the "Disable Project" option from Jenkins 2.89.4 onward in order to disable the pipeline Jobs.

- 424
- 5
- 2

- 4,871
- 3
- 33
- 43
-
3
-
@David I believe this is if your jobs are built automatically by a separate job finder - ours is called "seeder" but that may be an internal name. – Max Cascone Sep 17 '20 at 02:11
If you don't find the disable button. This should do the trick for most of the Jobs. Just append /disable
to the end of Job URL. Then Jenkins will redirect you to a page where you can Post
. Same applies for /enable
too

- 15,277
- 10
- 68
- 113
-
1Note that any config change toggles the flag, so you have to keep disabling it with this workaround. – MarkHu Sep 17 '19 at 17:03
-
I found out that I'm missing the needed permission this way. Weird that Jenkins just hides the "enable/disable" button in that case... – Lerk May 27 '20 at 09:56
-
FYI - no indicator of disabled status on the job. Though you can tell if you make note that the job's icon changes from the pipeline symbol to a dim folder. – Bill Tarbell Feb 03 '23 at 15:10
There is no option to disable jenkins-pipeline job.
The following jira ticket is tracking the issue:

- 191
- 1
- 3
-
7
-
1
-
Even though you can't disable the actual job, what you can do for a multi-branch pipeline is to add a filter for the branch names that excludes all branches (with a wildcard). – Joan Rieu Jan 08 '18 at 13:23
-
3@JoanRieu This immediately and completely wipes out the build history for that job; even if you undo the filter the first build starts back at 1 – Michael Mrozek Apr 17 '18 at 17:28
-
2Follow-up to my previous comment: you can prevent this by marking at least one build in each branch "keep forever". This causes the branch to be disabled instead of removed – Michael Mrozek Jun 05 '18 at 17:38
For multibranch pipeline projects,
- Click on pipeline 'configuration'
- Under the 'Branch Sources', below 'Property Strategy'
- click on 'ADD PROPERTY'
- select "Suppress automatic SCM triggering"
Now, no github branch trigger will run a build job. (This will disable triggers for all branches)

- 617
- 1
- 6
- 15
I have a similar case and found that a lot of our jobs are/were set up by an automatic "seeder" job that created them from Job DSL, and their configurations aren't editable. So i went to GitHub and disabled the webhook connecting the two. So the job is still active, but should never be triggered by GitHub activity anymore.

- 648
- 9
- 25
-
I just had to try this again and it didn't stop the hooks and the builds, so this may not work in all cases. – Max Cascone Sep 17 '20 at 02:12
If, like me, your Jenkins jobs are automatically created by a DSL workflow, you won't be able to edit the configuration of the top-level Job, that contains all the actual branches, to disable the automatic builds from github hooks. I can't currently find a way to programmatically disable an entire pipeline in the jenkinsfile, outside of using the when triggered by
clause on every stage as mentioned in this other SO answer. Besides, that would cause it to run and succeed, which might not be what we want.
So the solution that felt least-hacky to me was:
- Change the name of the Jenkinsfiles on all branches in your repo to something other than
Jenkinsfile
, so that Jenkins' SCM polling doesn't pick it up. I choseJenkinsfile.manual
. This assumes that the job-auto-creator is set to look for "Jenkinsfile"; adjust as necessary. - The auto-created job should delete itself the next time it scans the repo, whether that's from the github hook, a scheduled scan, or you pressing "scan now".
- Manually create a new Multibranch Pipeline job for your repo, setting the Build Configuration to look for
Jenkinsfile.manual
(or whatever you choose to call it). - Configure whatever branch Behaviors you would normally use, but also add a Property Strategy of All branches get the same properties > Suppress automatic SCM triggering.
This feels "right" to me, your mileage my vary.

- 648
- 9
- 25
I excluded all branches (Exclude: *
) in my Branch Sources
-> GitHub
-> Behaviors
-> Filter by name (with wildcards)
-> Exclude
section

- 30,998
- 16
- 147
- 256