Edit

Share via


Query work item history and discussion fields

Azure DevOps Services | Azure DevOps Server | Azure DevOps Server 2022 | Azure DevOps Server 2020

A work item's history records who created the item, what changed, and why the change occurred. This information supports traceability and auditing. When you add entries to the History field, include enough detail to help the next owner understand context and next steps.

Note

There is no separate Discussion field. To find comments added in the Discussion area, filter on the History field—all text entered into the Discussion box is appended to History.

Prerequisites

Category Requirements
Access levels - To view and run shared queries: Project member.
- To add and save a shared query: At least Basic access.
Permissions Contribute permission set to Allow for the folder that you want to add a query to. By default, the Contributors group doesn't have this permission.

Note

Users with Stakeholder access for a public project have full access to query features just like users with Basic access. For more information, see Stakeholder access quick reference.

Category Requirements
Access levels - To view and run shared queries: Project member.
- To add and save a shared query: At least Basic access.
Permissions Contribute permission set to Allow for the folder that you want to add a query to. By default, the Contributors group doesn't have this permission.

Supported operators and macros

  • Supported operators:

    • Contains Words
    • Does Not Contain Words
  • Search methods:

    • Exact phrase: locate an exact sequence of words.
    • Wildcard character (*): use only at the end of a partial word or phrase.
  • Full-text search: the History field is indexed for full-text search where the service supports it. (Azure DevOps Services exposes work item search by default; on-premises Azure DevOps Server requires the Search/Reporting feature to be installed and configured.)

Query a work item's history

You can use the web portal or Team Explorer to view a work item's history or search for work items based on the History field. Searching the History field returns only items with content recorded in that field and doesn't include structured changes made to other fields.

Screenshot that shows the Query Editor searching the History field.

List items based on the contents of the History field

Use the Query Editor to include the History field in a query clause.

  • Queryable content: comments entered in the Discussion area (History).
  • Nonqueryable content: revision metadata such as "Field X changed from A to B" isn't queryable through the History field.
  • Alternative search methods: to search words in rich-text fields (Description, Steps, Discussion), use work item search (see linked guidance).
  • Filter by change date: filter work items by when they changed or by a specific date range.

Filter for

Include these query clauses


Items whose History contains "reproducible"

History Contains Words reproducible

Items whose History doesn't contain "beta"

History Does Not Contain Words beta

Items that contain "stack traces" and were closed but later reactivated

History Contains Words "stack traces" And State Was Ever Closed And State <> Closed

Items closed within a date range (example)

State = Done And Closed Date > @Today - 30 And Closed Date <= @Today

Items with which I have an association

History Contains Words MyName Or Assigned To Was Ever _ @Me


Tips for using the query editor

  • Limit scope by date range to improve performance and return relevant results.
  • Use full words or exact phrases:
    • Partial words might not return matches. For example, "reproducible behavior" matches, but "repro" might not.
    • Use wildcards at the end of words or phrases, such as repro*.
  • Be aware of stop words: common words might get ignored by full-text indexing. See the linked guidance for stopword configuration.
  • Run and validate your query:
    • Select the run icon in the query editor toolbar to test the query.
    • If results are missing, adjust your terms and rerun.

View the history of work items

An entry appends to the History field each time you save a work item. To view history, open the work item and select the History tab (or Details for some work item types).

The exact history details vary by client and version.

Screenshot that shows the Work item form History tab in the web portal.

The state-change history diagram appears first; select Show all to see the full state-change timeline.

Screenshot that shows the state change history diagram in the web portal.

Select an entry to view the details of changes made.

Screenshot that shows details for a selected History entry in the web portal.

Filter the history view

The History tab records all changes to a work item to provide full traceability. Use filtering to find revisions by who updated an item or which fields changed.

Note

The Toggle filter feature requires the New Boards Hub feature (enabled by default). See the linked guidance to manage preview features.

To review updates by specific people, choose names from the Updated by menu.

Screenshot that shows filtering the History view by person.

To review updates to specific fields, choose fields from the Fields menu.

Screenshot that shows filtering History view by the Assigned To field.

Fields that support history, auditing, and revision tracking

Use these fields to filter queries and build reports. Some fields update as an item moves between states; others update when the item is modified. A few fields don't appear on the work item form but are tracked for the WITs shown.

Field name

Description

Work item type


Changed By

Name of the team member who most recently modified the work item.
Reference name=System.ChangedBy, Data type=String

All

Change Date

Date and time when a work item was modified.
Reference name=System.ChangedDate, Data type=DateTime

All

Closed Date 1

Date and time when a work item was closed.
Reference name=Microsoft.VSTS.Common.ClosedDate, Data type=DateTime

All

Created Date

Date and time when a work item was created.
Reference name=System.CreatedDate, Data type=DateTime

All

History

Record of changes appended after creation. Each revision indicates who made the change, when it occurred, and which fields changed.

Note

History queries return items whose Discussion or Description fields contain the search terms. You can't use the History field to query structured changes made to other fields.

The History field and the Description, Steps to Repro, and Title fields are indexed for full-text search where the service supports indexing.
Reference name=System.History, Data type=History

All

Resolved Date 1

Date and time when the work item moved into a Resolved state.
Reference name=Microsoft.VSTS.Common.ResolvedDate, Data type=DateTime

Bug (Agile, CMMI)

Rev

Revision number assigned to a historical revision of a work item.

Note

A work item revision limit of 10,000 applies to updates made through the REST API for Azure DevOps Services; portal updates aren't affected. (Verify current limits in the Azure DevOps REST API documentation.) Reference name=System.Rev, Data type=Integer

All

Revised Date

Date and time when a work item was revised.
Reference name=System.RevisedDate, Data type=DateTime

All

State Change Date

Date and time when the State field value changed.
Reference name=Microsoft.VSTS.Common.StateChangeDate, Data type=DateTime

All

Tracks operations performed when modifying a test suite (for example, adding tests or changing configurations). Viewable through the History tab or via queries.
Reference name=Microsoft.VSTS.TCM.TestSuiteAudit, Data type=PlainText

Test Suite

A system-managed, noneditable field that increments with changes to a work item.
Reference name=System.Watermark, Data type=Integer

All

Table notes

1 These fields must be included in the workflow (WORKFLOW) section of the WIT definition. For example, to set Resolved Date automatically:

<FIELD refname="Microsoft.VSTS.Common.ResolvedDate">
  <SERVERDEFAULT from="clock" />
</FIELD>