<p>Your first question is a duplicate of this <a href="https://stackoverflow.com/questions/34854377/how-to-change-workspace-and-build-record-root-directory-on-jenkins">question</a>.</p>
<p>Your second question. Each machine has a setting. So the Jenkins controller and the Jenkins Agent/s will each have its own setting.</p>
<p>You can change the workspace <a href="https://www.jenkins.io/doc/pipeline/steps/workflow-durable-task-step/#ws-allocate-workspace" rel="nofollow noreferrer">inside a pipeline</a>. But I have never seen anyone do it.</p>
<p>I can't answer your last question because I don't have a jenkins with that plugin to look at but it is something that can be configured. I see in the README an example for setting <a href="https://github.com/jenkinsci/configuration-as-code-plugin" rel="nofollow noreferrer">it on an Agent</a>.</p>
<p>EDIT: Thanks to <a href="https://devops.stackexchange.com/users/13379/ian-w">@Ian</a> we now know that those setters were moves to system properties. With that information I was able to research more on JasC and found that you can set the <code>rawBuildsDir</code> if you use the <code>restricted</code> flag. But you can set the <code>workspacedDir</code> unless you drop into a groovy init file. You can find all the information in this GitHub <a href="https://github.com/jenkinsci/configuration-as-code-plugin/issues/151" rel="nofollow noreferrer">issue</a>.</p>

CC BY-SA 4.0
2022-08-05T16:40:40.667Z
Something is different between the highest-voted answer to your first linked Q&A (https://stackoverflow.com/a/34918545/5437543), and my version of Jenkins: my `configuration` page has the read-only value of `Home directory`, but no fields at all (not even read-only) for `Workspace Root Directory` or `Build Record Root Directory`.
StoneThrow
CC BY-SA 4.0
2022-08-06T05:45:04.820Z
Several years ago (but after the linked answer, `Build Record Root Directory` [as removed from UI as unsafe](https://issues.jenkins.io/plugins/servlet/mobile#issue/JENKINS-50164).  Now a [system property](https://www.jenkins.io/doc/book/managing/system-properties/#jenkins-model-jenkins-buildsdir). Same for [workspace](https://www.jenkins.io/doc/book/managing/system-properties/#jenkins-model-jenkins-workspacesdir).
Ian W
CC BY-SA 4.0
2022-08-05T01:50:15.100Z
2022-08-07T15:14:45.307Z
2022-08-07T15:14:45.307Z
Levi
<p>I don't know where this is set, but jobs from my Jenkins 2.289.2 server appear to be working out of the directory <code>/home/jenkins/workspace/${job_name}</code>. E.g. if I have a minimal pipeline script that just <code>touch</code>es a path-unspecified file, it ends up in that directory.</p>
<p><strong>Question:</strong> where is this setting viewable or editable in the Jenkins web UI?<br />
<strong>Question:</strong> (assuming this is an editable setting) is this editable per-job, or is this only a global configuration?<br />
<strong>Question:</strong> is this setting viewable in &quot;Configuration as Code&quot;? I don't see the directory anywhere in the yml generated by the <code>View Configuration</code> button at <code>${jenkins_url}:8080/configuration-as-code/</code></p>

<jenkins>
Does Jenkins 2.289.2 have a customizable workspace?
StoneThrow
# Does Jenkins 2.289.2 have a customizable workspace?

(Asked by: username_0 on 2022-08-05)

I don't know where this is set, but jobs from my Jenkins 2.289.2 server appear to be working out of the directory `/home/jenkins/workspace/${job_name}`. E.g. if I have a minimal pipeline script that just `touch`es a path-unspecified file, it ends up in that directory.

**Question:** where is this setting viewable or editable in the Jenkins web UI?  
**Question:** (assuming this is an editable setting) is this editable per-job, or is this only a global configuration?  
**Question:** is this setting viewable in "Configuration as Code"? I don't see the directory anywhere in the yml generated by the `View Configuration` button at `${jenkins_url}:8080/configuration-as-code/`

**Tags:** jenkins


---

## 1 answers

### Answer by username_1 on 2022-08-05. Score: 1 | Accepted answer

Your first question is a duplicate of this [question](https://stackoverflow.com/questions/34854377/how-to-change-workspace-and-build-record-root-directory-on-jenkins).

Your second question. Each machine has a setting. So the Jenkins controller and the Jenkins Agent/s will each have its own setting.

You can change the workspace [inside a pipeline](https://www.jenkins.io/doc/pipeline/steps/workflow-durable-task-step/#ws-allocate-workspace). But I have never seen anyone do it.

I can't answer your last question because I don't have a jenkins with that plugin to look at but it is something that can be configured. I see in the README an example for setting [it on an Agent](https://github.com/jenkinsci/configuration-as-code-plugin).

EDIT: Thanks to [@Ian](https://devops.stackexchange.com/users/13379/ian-w) we now know that those setters were moves to system properties. With that information I was able to research more on JasC and found that you can set the `rawBuildsDir` if you use the `restricted` flag. But you can set the `workspacedDir` unless you drop into a groovy init file. You can find all the information in this GitHub [issue](https://github.com/jenkinsci/configuration-as-code-plugin/issues/151).

> **Comments:**
> **username_0**: Something is different between the highest-voted answer to your first linked Q&A (https://stackoverflow.com/a/34918545/5437543), and my version of Jenkins: my `configuration` page has the read-only value of `Home directory`, but no fields at all (not even read-only) for `Workspace Root Directory` or `Build Record Root Directory`.  
> **username_2**: Several years ago (but after the linked answer, `Build Record Root Directory` [as removed from UI as unsafe](https://issues.jenkins.io/plugins/servlet/mobile#issue/JENKINS-50164).  Now a [system property](https://www.jenkins.io/doc/book/managing/system-properties/#jenkins-model-jenkins-buildsdir). Same for [workspace](https://www.jenkins.io/doc/book/managing/system-properties/#jenkins-model-jenkins-workspacesdir).  

---

