When a user invoke "New Job" from a view, I think the expected behavior is that new item is included in the view.
Unless it's the default view. How else are you creating jobs, if not in a view? There's no way (except by entering the URL or using weird view types) to create a job and not have it listed in any way. Since Folders plugin always uses a list view as default view, using a different view type as default won't work.
I've reworked to add option to disable job selector:
Not sure this is approach is better than the earlier one. I have a default view with manually selected contents. Any newly created jobs are added to that view automatically (unless users select a different view first). To disable automatically adding jobs, I need to use a workaround to get the manually selected content.
How about the following:
Let's assume that the problem is mostly with the default view in the current ViewGroup, because users who just want to create a new job usually select the ItemGroup<TopLevelItem> the job should be in (i.e. Jenkins homepage, or a folder), and then create it there.
Further, note that URLs /.../ and /.../view/DefaultViewName/ both exist and show the same view (you navigate to the latter after saving a default view's configuration). Unfortunately, when clicking the 'DefaultViewName' tab, you're directed to /.../ instead of /.../view/DefaultViewName/.
How about 1) the 'New Job' link simply links to (effectively) $currentUrl/newJob, and 2) the tab title for 'DefaultViewName' links to /.../view/DefaultViewName/? Then you won't automatically add jobs to the default view if you just selected its parent, but will be able to add jobs to it when navigating there deliberately.
Unfortunately, this will behave weirdly when you only have one view. In that case, a redirect to /.../view/DefaultViewName/ might work: If there are other views, don't add the job anywhere, otherwise add to the default view.
Maybe the solution is to get rid of the default view entirely and use a dashboard-like or nested-view-like view instead, whose 'Add' link doesn't have add jobs anywhere by default. Won't work for Folders plugin unfortunately, as the default view is always a list view.
To explain my particulat need for this:
Also adding one of my use cases: I have a Jenkins instance with ~6500 jobs which build and bundle components for a rather large software distribution. Nobody cares about these jobs as long as they're successful, and showing list views with 150-4500 jobs each (distinguished by type, and no further division is useful) wouldn't be productive. So the only views I have only show unstable, failing, or disabled jobs, using View Job Filters. When someone adds a new job, it makes no sense to add it to one of these computed views.
Duplicate of
JENKINS-19142See workaround mentioned there - add a filter (i.e. regex filter) to filter out all jobs as your first filter, then add jobs back in with filters.