Close resolved work after 30 days in Azure DevOps
Daily, find items in the Resolved state category unchanged for 30+ days, set State to Completed (Closed or Done for the work item type), and add a comment (max 50 per run; the rest wait for the next day) in Azure DevOps.
By using this template, you can ensure that your backlog remains current by transitioning stale work items to a Completed state and adding a comment to document the change. Before enabling, you'll need to set the inactive window, comment text, and timezone.
Prerequisite: Install Automations App on your Azure DevOps organization
Trigger — Schedule
This trigger initiates the automation on a daily schedule. It is set to run every day at 09:00 UTC, ensuring that work items are regularly checked for inactivity.
Configured in this template
- Occurrence: Every day at 09:00 (UTC)
You can customize
- Change the occurrence time to better suit your team's working hours.
- Adjust the frequency if you need more or less frequent checks.
Get — Search work items
This step searches for work items that have been in the Resolved state for more than 30 days and have not been closed. It loads up to 200 items that meet these criteria.
Configured in this template
- Field conditions:
- - State = state category Resolved
- - Changed Date < @Today-30
- - Closed Date Is Empty
- logic: and
You can customize
- Modify the state category or add more conditions to refine the search.
- Adjust the date range to target different periods of inactivity.
Condition — Smart Value compare
This condition checks if there are any items found by the previous step. It ensures that the automation only proceeds if there are items to update.
Configured in this template
- Value: `
{items.Count}` - Operator: >
- Compare to: 0
You can customize
- Change the comparison logic if you want to set different thresholds for processing.
Action — Update Work Item
This action updates the state of the work items found in the previous step to Completed, which could be Closed or Done depending on the work item type.
Configured in this template
- Work on: Items from Get
- Field updates: State = state category Completed (Closed, Done, …)
You can customize
- Change the target state to match your project's workflow.
- Update additional fields if needed.
Action — Add Comment
This action adds a comment to each work item processed, noting that it was closed due to inactivity for over 30 days.
Configured in this template
- Work on: Items from Get
- Comment text: Closed because this item stayed Resolved for 30+ days with no updates.
You can customize
- Edit the comment text to provide more context or details.
- Add additional comments if needed.
Full automation
Common questions
How do I close resolved work after 30 days in Azure DevOps?
What fields are required to enable this automation?
Can I change the work item types this automation affects?
How can I test this automation?
How do I adjust the schedule or timezone?
Visual Studio Marketplace
Automations
Automate Azure DevOps workflows with triggers, actions, conditions, and scheduled rules.