Using the REST API to see file differences in a personal build

When a personal build runs, the user's files replace the current VCS file versions in the build folder and the original files are put back when the build completes.

Is there a way, using the rest API, to see the differences between the files in the personal build changelist and those in th ecurrent VCS?

0
1 comment

Hi, 

There isn't a direct REST API endpoint that provides a file-level diff between a personal build and the VCS version.

However, you can retrieve the change ID of a personal build using the following REST API call:

GET  {TeamCity_URL}:{port}/app/rest/changes?locator=build:(id:{yourBuildId})&&fields=change(id,version,files)

Once you have the changeId, you can download the patch file that contains the file differences using this URL:

GET {TeamCity_URL}:{port}/downloadPatch.html?buildTypeId={yourBuildTypeId}&modId={changeId}&personal=true.

This patch file includes the differences between the files in the personal build and those in the current VCS version.

Best Regards,

Tom

0

Please sign in to leave a comment.