Skip to content

Close resolved work after 30 days in Azure DevOps

  • Azure DevOps
  • Automation
  • Schedule & bulk
  • State
  • Bulk
Close resolved work after 30 days flow overview
Overview of the flow to close resolved work after 30 days.

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

Create an automation from the Close resolved work after 30 days template, or start from scratch
Go to Project → Automations → Create automation from template Close resolved work after 30 days or Start from scratch.
Trigger

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.
Close resolved work after 30 days trigger
Schedule trigger set to run daily at 09:00 UTC.
Get

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.
Close resolved work after 30 days action 1
Search work items action with conditions for state and date.
Condition

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.
Close resolved work after 30 days condition 1
Smart Value compare condition ensuring items exist to process.
Action

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.
Close resolved work after 30 days action 2
Update Work Item action to change state to Completed.
Action

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.
Close resolved work after 30 days action 3
Add Comment action with a note about the closure reason.

Full automation

Close resolved work after 30 days full automation
Full builder canvas showing the complete automation flow.

Common questions

How do I 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. Use the Close resolved work after 30 days template in Documentero Automations: open Templates, pick this flow, fill the required fields, and enable it.
What fields are required to enable this automation?
You need to set the inactive window, comment text, and timezone before enabling the automation.
Can I change the work item types this automation affects?
Yes, you can adjust the field conditions in the Search work items step to target different work item types.
How can I test this automation?
You can test the automation by running it manually after setting it up and ensuring it processes the expected work items.
How do I adjust the schedule or timezone?
You can change the schedule in the Schedule trigger settings and update the timezone to match your local time.

Visual Studio Marketplace

Automations

Documentero · Preview

Automate Azure DevOps workflows with triggers, actions, conditions, and scheduled rules.

Get it free