Question: Is there any way to create TeamCity build parameter and fill it by some value from VCS? It can be maven property "project.version", some number taken from text file or so. Goal is to store version number **only** in VCS and not to have to change it on both places.

Answer: 
You could use TeamCity [service messages](https://confluence.jetbrains.com/display/TCD10/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-servMsgsServiceMessages) to set parameter during build.

To set or update build parameter you should use following syntax:

```
##teamcity[setParameter name='myPar' value='myValue']

```

For example one might create `Command Line` build step to read value from a file and save that value as a parameter; then this parameter is available in next build step(s) and also in builds, depending on this one (via %dep.\*% parameter references).
You can find the answer to the exact same question in another post here: [Setting build parameters from external file in TeamCity](https://stackoverflow.com/questions/34593407/setting-build-parameters-from-external-file-in-teamcity).

Copied and pasted the answer:

You can define a parameters file which you check into version control, and then update the scheme to %system.major\_version%.%system.minor\_version%.%build\_number%.0. Then you can keep using AssemblyInfo Patcher, but patch everything based on the values in the props file.

Just put the following in a file named teamcity.default.properties in your project root:

system.major\_version=3
 system.minor\_version=15

This will result in the build number 3.15.1234.0 for build #1234.