Skip to content

Set up the Stale Item Wizard

Use this page as a field-by-field reference for the Stale Bot task in Azure DevOps. It covers every current option exposed by the task wizard and the matching YAML input names.

What the task does

The Stale Bot scans work items for inactivity, adds a stale tag and comment when an item crosses your threshold, and can optionally close and archive items that stay inactive after being marked stale.

Option groups

Core behavior

Wizard labelYAML inputTypeDefaultWhat it controls
Days Until StaledaysUntilStaleinteger30Number of days with no updates before a work item is marked stale. 0 is allowed and marks eligible items immediately.
Close Stale ItemscloseStaleItemsbooleanfalseEnables the second pass that revisits already-stale items and closes them if they remain inactive.
Close Stale Items After DayscloseStaleItemsAfterDaysinteger7Number of days to wait after the stale tag is added before closing the item. This field is only shown when closeStaleItems is enabled.
Dry RundryRunbooleanfalseLogs what the task would mark, rescue, close, or archive without making any changes.

Stale markers

Wizard labelYAML inputTypeDefaultWhat it controls
Stale TagcustomStaleTagstringstaleTag applied to items when they become stale. Do not use commas, semicolons, or @.
Stale CommentcustomStaleCommentstringblankComment posted when an item is marked stale. If left empty, the task uses: This item has been marked stale. Please update within X days or it will be closed.
Included Work Item TypesincludedItemTypescomma-separated stringUser Story,TaskLimits the scan to specific work item types such as Bug, Issue, Task, or Product Backlog Item.

Notifications

Wizard labelYAML inputTypeDefaultWhat it controls
Notify AssigneenotifyAssigneebooleanfalseAdds an @mention for the assigned user in the stale or close comment when an assignee exists.
Notify Creator On UnassignednotifyCreatorOnUnassignedbooleanfalseIf the work item is unassigned, mention the creator instead. This only has an effect when notifyAssignee is also enabled.

Exemptions

Wizard labelYAML inputTypeDefaultWhat it controls
Exempt Active IterationsexemptActiveIterationsbooleanfalseSkips items that are currently in active or future iterations.
Exempt Area PathsexemptAreaPathscomma-separated stringblankSkips items under the listed area paths. You can provide paths with or without the project prefix.
Exempt IterationsexemptIterationscomma-separated stringblankSkips items under the listed iteration paths. You can provide paths with or without the project prefix.
Exempt TagsexemptTagscomma-separated stringblankSkips items that contain any of the listed tags. Tags cannot contain commas, semicolons, or @.

Archiving

Wizard labelYAML inputTypeDefaultWhat it controls
Auto ArchiveautoArchivebooleanfalseMoves items to an archive area path when they are closed by the bot.
Archive PatharchivePathpick listblankTarget area path used when autoArchive is enabled. This field is only shown when autoArchive is enabled.

Important option interactions

CombinationResult
autoArchive: true and closeStaleItems: falseInvalid configuration. The task throws an error because items are only archived as part of the close flow.
autoArchive: true with no archivePathInvalid configuration. You must choose a valid area path.
notifyCreatorOnUnassigned: true and notifyAssignee: falseNo mention is added. Creator fallback is only used inside the notification flow.
Activity after an item is marked staleThe bot removes the stale tag instead of closing the item. Both field updates and new comments count as activity.

Input format notes

FieldExpected format
includedItemTypesComma-separated names such as User Story,Task,Bug
exemptTagsComma-separated tag names such as do-not-stale,high-priority
exemptAreaPathsComma-separated area paths such as Project\Support,Project\Archive\Manual Review
exemptIterationsComma-separated iteration paths such as Project\Sprint 20,Project\Release Train
archivePathA valid Azure DevOps area path using backslashes, for example Project\Archive

The task trims extra spaces around comma-separated values. For area and iteration paths, the project name is added automatically if you omit it.

Example YAML

- task: StaleBotTask@1
displayName: Run stale bot
inputs:
daysUntilStale: '30'
closeStaleItems: true
closeStaleItemsAfterDays: '7'
dryRun: false
customStaleTag: stale
customStaleComment: This item has been marked stale. Please update it if work is still active.
includedItemTypes: User Story,Task,Bug
notifyAssignee: true
notifyCreatorOnUnassigned: true
exemptActiveIterations: true
exemptTags: do-not-stale,keep-open
exemptAreaPaths: Product\\Security,Product\\Leadership
exemptIterations: Product\\Hotfix
autoArchive: true
archivePath: Product\\Archive

If you are enabling the task for the first time, start with a dry run and a narrow scope:

  1. Set dryRun to true.
  2. Limit includedItemTypes to the work item types your team actually uses.
  3. Add any exemption tags or paths that should never be touched.
  4. Turn on closeStaleItems only after reviewing one or two dry run reports.
  5. Turn on autoArchive last, after you confirm the archive area path exists.