Azure DevOps work items for example User Story work item can be moved from one state to another in a workflow. As per this question in tech communties a requirement is there to resrict a New state user story from moving to Closed state directly. But if the uer story is in another state such as Active it should be able to moved to Closed state. Let's explore how to implement a solution for this Azure DevOps.
We can use customized templates in Azure DevOps to customize the work items and work flows. To restrict moving a user story from New to Closed state we can implement a rule in user story work item as below.
- Open custom template user story work item.
- Then go to rules tab and add a new rule.
- Provide a rule name.
- Add condition "Work item state is moved from" and select New as the value.
- Add action "Restrict transition to state" and select Closed as the value.










