# JSON File Change

**URL:** <https://community.jenkins.io/t/json-file-change/3147>\
**Category:** Ask a question\
**Created:** [July 25, 2022, 11:43am UTC](https://community.jenkins.io/t/json-file-change/3147 "2022-07-25T11:43:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iambuka](https://avatars.discourse-cdn.com/v4/letter/i/3d9bf3/32.png) [@iambuka](https://community.jenkins.io/u/iambuka)\
**Post date:** [July 25, 2022, 11:43am UTC](https://community.jenkins.io/t/json-file-change/3147/1 "2022-07-25T11:43:40Z")

</div>

Hello, I have c# project with selenium, Built jenkins freestyle project, it triggers and works great. I have 1 issue. I have configuration file in json, where I am specifing the name of branch of URL where tests should run. for example branch is [something.workspace.com](http://something.workspace.com) i am writting “something” in that json file to run tests. Now i want to run tests on different enviroment so can you tell me how to change that “something” in my json file from jenkins configuration ? Thank you

---

<div class="post-metadata">

**Author:** ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)\
**Post date:** [July 25, 2022, 4:34pm UTC](https://community.jenkins.io/t/json-file-change/3147/2 "2022-07-25T16:34:16Z")

</div>

so in pipeline (which i recommend migrating to) there’s readJSON and writeJSON for specifically this need.

For freestyle I’m not sure there’s anything for this. (I’m assuming windows cause c#) I would recommend running a execute batch step that just does a replace statement. It’ll probably be good enough - [Replace text within a text file with Windows command line - Stack Overflow](https://stackoverflow.com/a/19006703)

If thats not safe enough, you could use a tool like jq - [bash - Replacing values in json file with jq - Code Review Stack Exchange](https://codereview.stackexchange.com/a/140057)

---

<div class="post-metadata">

**Author:** ![iambuka](https://avatars.discourse-cdn.com/v4/letter/i/3d9bf3/32.png) [@iambuka](https://community.jenkins.io/u/iambuka)\
**Post date:** [July 26, 2022, 1:04pm UTC](https://community.jenkins.io/t/json-file-change/3147/3 "2022-07-26T13:04:01Z")

</div>

thanks i will try and inform if it works
