NH.
NH.

Reputation: 2381

How can you cancel a Code Review Request?

I made some changes and then requested Code Review in TFS, then realized I had made the changes to the wrong branch. So I tried to delete the work item to show that I no longer needed code review (at least in this branch). However, when I tried to do that, I got the beautiful red error:

Failed to delete work item: 1061. Error Details: VS402838: The work item 1061 cannot be deleted. Code Review Request work items cannot be deleted.

For now, I'll just have everybody complete the code review where it sits, and then I'll make the exact same changes in the correct branch. But I'm wondering what you are supposed to do in this case if they insist you can't delete Code Review Request work items.

Upvotes: 13

Views: 9954

Answers (3)

ruffin
ruffin

Reputation: 17453

I think The Right Thing to do in TFS-land is to Abandon the Code Review, since you can't delete it from TFS.

The previous answers have two means of doing that. Here's a third, from within Visual Studio, since that seemed like a convenient alternative.


  1. Open My Work in the Team Explorer window.

my work link in the Team Explorer interface

  1. Find the Code Reviews section of My Work.

my work section of Team Explorer

  1. Right-click the Code Review you want to Abandon.

  2. Select Open.

  3. In the Code Review UI, select Close Review for the reason Abandon

Code Review UI with Close Review highlighted

  1. Profit.

Upvotes: 4

NH.
NH.

Reputation: 2381

This can be accomplished by creating a query that includes the desired work item, then editing it from within the query.


  1. Create a new query, then specify criteria such as Created By (yourself) that will find the work item. ID doesn't work so well if the work item was already assigned out, as each reviewer has their own work item.
  2. Right-Click the work item you want to edit.
  3. Select edit from the context menu.

Steps 1-3:

Steps 1-3 in image form

  1. In the window that comes up, enter "State" for Field and "Closed" for Value: State: Closed
  2. Enter some notes about the manual change and then close the dialog with the "OK" button, and then don't forget to save your changes with this button:

enter image description here

Upvotes: 20

Tony Dong
Tony Dong

Reputation: 3313

You can cancel a code review required by using excel

Please try this workaround: create a work query to get all that user’s Code Review Request work items which in Requested state, save this work item query and open this query in Excel, then edit them work items in Excel to change the state to Closed, then click Publish button to publish the updates to TFS Server.

See this URL https://social.msdn.microsoft.com/Forums/vstudio/en-US/83d96317-cdd7-436c-8415-fda54d1ce752/cancel-a-code-review-request?forum=tfsworkitemtracking

Upvotes: 1

Related Questions