For TFS task, is it possible to add constraint when someone tries to change its state to "Resolved"? The purpose is to specify that the task can only be changed to resolved if someone has reviewed and approved it.
Other option
If "Test" is specified, then "Test Outcome" must be "Pass" in order to change the state to "Resolved".
Per the requirement to set constraint to change the state of a work item, we can leverage work items rules as suggested in this document on Restrict workflow transitions, apply rules to workflow states - Azure DevOps Services | Microsoft Learn
Here are some simplified steps as a sample for your reference.
Created a custom work item field of Approved by
for the Task
work item type in the inheritance process;
Add the following the work item rules;
When a user who is not a member of the PCA group is trying to change the state of a Task
to Resolved
, the user will be prevented by the failure in updating the required Approved by
field;
While one of the PCA group members is able to change a Task
to the Resolved
state and update the Approved by
field;
To ensure a smooth transition, we recommend creating a test process and project, which allows you to test your customizations before you implement them organization-wide. Please go throught the document above for more examples/scenarios with more details.