EDIT: Per other comments, the "Advanced..." button appears to have been removed in more recent versions of Jenkins. If your version doesn't have it, see knorx's answer.
I had the same problem, and even after finding this old pull request I still had trouble finding where to specify the Workspace Root Directory or Build Record Root Directory at the system level, versus specifying a custom workspace for each job.
To set these:
Jenkins
-> Manage Jenkins
-> Configure System
Home directory
, click the Advanced...
button:
This value may include the following variables:
${JENKINS_HOME}
— Absolute path of the Jenkins home directory${ITEM_ROOTDIR}
— Absolute path of the directory where Jenkins stores the configuration and related metadata for a given job${ITEM_FULL_NAME}
— The full name of a given job, which may be slash-separated, e.g. foo/bar for the job bar in folder foo
The value should normally include${ITEM_ROOTDIR}
or${ITEM_FULL_NAME}
, otherwise different jobs will end up sharing the same workspace.