Sindu_
Sindu_

Reputation: 1465

Cannot close code review response work items in Visual Studio or DevOps

I'm trying to close a code review response work item in Devops/Visual studio and I get the Field 'Closed Status' cannot be empty error and I am unable to close the work item. The Closed Status is not editable in Visual Studio or DevOps.

Visual Studio

DevOps

I don't want to be editing the "Closed Status" in excel, I need a easier way of handling this. Any ideas?

Upvotes: 1

Views: 841

Answers (2)

Emre Utku Solak
Emre Utku Solak

Reputation: 316

Update 2024

This is still a bug, and solving it is not straightforward. I assume that Microsoft is not sharing a solution to this issue as a security concern.

Like many others, I tried to set the Code Review Response's State to "Closed" and it complained that the Closed Status cannot be empty. However, I was unable to set the Closed Status through the web interface of Azure DevOps because it displayed the Closed Status as a "Readonly field". Therefore, it was not displayed in the editable fields.

My workaround for people who are frustrated for not being able to find a way to set the active Code Review Response state to "Closed" using the web interface is the following:

1- Open Microsoft Azure Command Prompt and log in using the following (you may need to set your default organization and project before this):

az login --allow-no-subscriptions

2- Set the work item state to Closed and Closed Status to "Removed" using the following (don't forget to replace your work item ID with 1234, also note that you can set the Closed Status to other allowed values):

az boards work-item update --id 1234 --state "Closed" --fields "Microsoft.VSTS.CodeReview.ClosedStatus=Removed"

It took me a while to come up with this workaround. I hope it saves some hours for others.

Upvotes: 0

wade zhou - MSFT
wade zhou - MSFT

Reputation: 8488

I can reproduce the same, after investigation, it's a known issue which reported here.

You can use the workaround below to close them:

  1. Open the code review requests in a DevOps query.

  2. Select the request, on the right side pane, change the state to closed, it will report the error. Ignore that error and continue to step3. enter image description here

  3. click ... on the left pane after the ticket name, click edit: enter image description here

  4. In the popup select "Close Status Code" and pick value 5 and press OK. This will update the Closed Status (which was the cause for the error that we saw in step 2). enter image description here

  5. Now just press Save and the ticket will be closed. enter image description here

Upvotes: 3

Related Questions