Nelson Rothermel
Nelson Rothermel

Reputation: 9746

Close code review without opening?

I moved one of our top-level folders which has many files below. Since it's policy to create a code review request for every commit, I did so. Opening the review takes a loooong time as it tries to load every file in the hierarchy and eventually crashes Visual Studio. Is there any way to close/abandon the review without opening it?

Upvotes: 0

Views: 552

Answers (1)

Nelson Rothermel
Nelson Rothermel

Reputation: 9746

I remembered I had TFPT (Team Foundation Power Tools) installed, checked if there was anything related to work items and got lucky. I looked up the work item ID from Visual Studio (for example, 1234) and did the following:

  1. Run tfpt workitem 1234. This gave me a dump of fields and their values.
  2. Run the above command for another code review that was already closed.
  3. Compare #1 and #2 to see what the differences were
  4. Run the following command to close the original review: tfpt workitem 1234 /update /fields:"State Code=1;Closed Status=Completed;Closed Status Code=3;Closed By=My User ID;Closed Date 1/1/2000 12:00 PM;Reason=Closed;State=Closed"

I tried changing the Changed Date field but that wasn't allowed. I was also missing one of the fields and was getting a TFS237124: Work Item is not ready to save error, but eventually got the right combination.

Upvotes: 1

Related Questions