%system.teamcity.build.changedFiles.file% is not set when running a custom build

When I run a custom build and include a specific change I want to access the %system.teamcity.build.changedFiles.file% parameter inside my build script. Right now I map it the %system.teamcity.build.changedFiles.file% parameter to Environment Variables as env.ChangedFilesFile and I can see that the parameter is set to this in the custom build configurations. It works without any problems when doing a regular build.

Is this by design or am I missing something to make this work?

Best regards,
Matt

5 comments
Comment actions Permalink

I don't understand what exactly is the problem. The parameter you mentioned is set on both default and custom builds.

0
Comment actions Permalink

Really? When I run a custom build and choosing an old Change in the Changes tabs the %system.teamcity.build.changedFiles.file% parameter is empty even though the old change had changed files.

I expect to have the same changed files as when I ran it as a default build but from what I've tested it seems to be empty when I run a custom build with an old change.

Best regards,
Matt

0
Comment actions Permalink

oh, I got it. The file mentioned is parameter points to files changed in the build against last build in main order (i.e. build with incremental changes). For historical build, this list is empty, yes.

0
Comment actions Permalink

Do you know of any way to make my scenario work? Right now I have a kind of workaround by using the REST API where I can get the changed files, but that doesn't contain file status that the %system.teamcity.build.changedFiles.file% parameter has (ADDED/REMOVED/CHANGED) that I also need in my build script.

Best regards,
Matt

0
Comment actions Permalink

You probably mean that kind of REST API request: /app/rest/changes/id:538, which can be found from build request. Unfortunately, the information about file status is not available now. Please open a request at http://youtrack.jetbrains.com.

0

Please sign in to leave a comment.