Share via


How To Checkin Files To 2 TFVC Projects At The Same Time

3/21/2017

Jeff here from the VSTS support team.

Someone asked how to map 2 VSTS TFVC Projects so we can checkin files to both projects at the same time. They wanted to see how TFVC/VSTS shows 2 projects for the same checkin notification(in particular, the teamProjectIds field). We can easily see that with a Web Hook Service Hook when we link our VSTS account to RequestBin for checkin notifications.

snap002056 snap002057 snap002058

Let’s connect to the first VSTS TFVC Project in Visual Studio:

snap002059

And map it to a folder underneath a folder that will be the root for both the TFVC projects we are going to checkin changes together for. I added TFVC to the default path, so I know these TFVC projects are together.

snap002060

Now let’s go to Source Control Explorer to map the second TFVC project:

snap002061 snap002062

After we map it, we can create some files to get checked in.

snap002063 snap002065

And then add them to Source Control:

snap002064 snap002066

Here are the files waiting to be checked in:

snap002067 snap002068

Here are the pending changes waiting to be checked in:

snap002069

Here is the resulting checkin for those 2 files in 2 projects:

snap002070

Here is the full XML for the checkin:

"subscriptionId":"61a792ce-9ddc-40a5-811e-0640ab08800f","notificationId":1,"id":"6eb85409-f7b7-4fc0-bc4d-aac5bca1fb05","eventType":"tfvc.checkin","publisherId":"tfs","scope":"all","message":{"text":"VSTS Blog checked in changeset 8: VSTS-Blog - Double Checkin","html":"VSTS Blog checked in changeset <a href=\"https://vsts-blog.visualstudio.com/web/cs.aspx?pcguid=9a0adf58-227a-4bce-adc9-f5450850aad6&amp;cs=8\">8</a>: VSTS-Blog - Double Checkin","markdown":"VSTS Blog checked in changeset [8](https://vsts-blog.visualstudio.com/web/cs.aspx?pcguid=9a0adf58-227a-4bce-adc9-f5450850aad6\&cs=8): VSTS-Blog - Double Checkin"},"detailedMessage":{"text":"VSTS Blog checked in changeset 8: VSTS-Blog - Double Checkin","html":"VSTS Blog checked in changeset <a href=\"https://vsts-blog.visualstudio.com/web/cs.aspx?pcguid=9a0adf58-227a-4bce-adc9-f5450850aad6&amp;cs=8\">8</a>: VSTS-Blog - Double Checkin","markdown":"VSTS Blog checked in changeset [8](https://vsts-blog.visualstudio.com/web/cs.aspx?pcguid=9a0adf58-227a-4bce-adc9-f5450850aad6\&cs=8): VSTS-Blog - Double Checkin"},"resource":{"hasMoreChanges":true, "teamProjectIds":["0695931c-21c0-47e6-904c-add0c2d1527f","83416a37-d523-417c-93a2-b8bf6dee7e4b"] ,"changesetId":8,"url":"https://vsts-blog.visualstudio.com/_apis/tfvc/changesets/8","author":{"id":"d24ac5a3-ae7e-6858-8bff-2ae8420c64be","displayName":"VSTS Blog","uniqueName":"VSTS-Blog@outlook.com","url":"https://app.vssps.visualstudio.com/A958272a6-6094-4330-aaa1-23c3b9b80363/_apis/Identities/d24ac5a3-ae7e-6858-8bff-2ae8420c64be","imageUrl":"https://vsts-blog.visualstudio.com/_api/_common/identityImage?id=d24ac5a3-ae7e-6858-8bff-2ae8420c64be"},"checkedInBy":{"id":"d24ac5a3-ae7e-6858-8bff-2ae8420c64be","displayName":"VSTS Blog","uniqueName":"VSTS-Blog@outlook.com","url":"https://app.vssps.visualstudio.com/A958272a6-6094-4330-aaa1-23c3b9b80363/_apis/Identities/d24ac5a3-ae7e-6858-8bff-2ae8420c64be","imageUrl":"https://vsts-blog.visualstudio.com/_api/_common/identityImage?id=d24ac5a3-ae7e-6858-8bff-2ae8420c64be"},"createdDate":"2017-03-21T17:30:25Z","comment":"VSTS-Blog - Double Checkin"},"resourceVersion":"1.0","resourceContainers":{"collection":{"id":"9a0adf58-227a-4bce-adc9-f5450850aad6","baseUrl":"https://vsts-blog.visualstudio.com/"},"account":{"id":"958272a6-6094-4330-aaa1-23c3b9b80363","baseUrl":"https://vsts-blog.visualstudio.com/"}},"createdDate":"2017-03-21T17:30:29.0671123Z"}

/Jeff

Happy Developing!