title | titleSuffix | description | ms.technology | ms.assetid | ms.author | author | ms.topic | monikerRange | ms.date |
---|---|---|---|---|---|---|---|---|---|
Query by history |
Azure Boards |
Learn how to query comments and history to work items to support audit requirements when working in Azure Boards |
devops-agile |
A5AC271A-8DF0-40AD-9867-1B1E9E5B1FE9 |
kaelli |
KathrynEE |
example-scenario |
>= tfs-2013 |
08/27/2020 |
[!INCLUDE temp]
The history of a work item tells you who opened the item, what changed, and why. This information helps you track how an item changes over time. When you enter information in the history field, provide as much information as possible to help the next work item owner understand what has happened and what they have to do.
Note
There is no Discussion work item field. To query work items with comments entered in the Discussion area, you filter on the History field. The full content of the text entered into the Discussion text box is added to the History field.
Query clauses that specify the History field can use the Contains Words and Does Not Contain Words operators. Search against an exact phrase or to use the wildcard character, *. You can only use the wildcard character at the end of a partial word or phrase.
The History field is automatically indexed for full-text search when full-text search is available. See Full-Text and partial word searches
You can use either the web portal or Team Explorer to view the history of a work item or find work items based on the contents of the History field. When you perform a search on the contents of the History field, it returns only work items that have changes recorded in that field. That is, it doesn't register changes that were made to text in other fields.
::: moniker range=">= tfs-2017"
::: moniker-end
::: moniker range=">= tfs-2013 <= tfs-2015"
::: moniker-end
The Query Editor isn't available when you are connected to a GitHub or third-party Git repository. Also, it isn't available from Visual Studio 2019 under the following conditions:
- If you are set to use the default Landing page experience as described in Set the Work Items experience in Visual Studio 2019.
- If you are set to use the new Git Tool as described in Git experience in Visual Studio.
Visual Studio/Team Explorer and Team Explorer Everywhere
::: moniker range=">= tfs-2017" You use the query editor to add the History field to a query clause. Comments entered into the Discussion area are queryable. Change history entries, such as which fields were changed, aren't queryable. To quickly find items based on words entered into the Discussion area, or Description or other rich-text fields, consider using work item search. ::: moniker-end
::: moniker range=">= tfs-2013 <= tfs-2015" You use the query editor to add the History field to a query clause. Comments entered into the History field are queryable. Change history entries, such as which fields were changed, aren't queryable. ::: moniker-end
You can filter for work items by the date on which they were changed or for a specific time period. If you limit the scope of your query, it can help with performance by only returning those results that fit the date range that you want to include.
Filter for | Include these query clauses |
---|---|
Items whose History field contains the word "reproducible" |
History Contains Words reproducible |
Items whose History field doesn't contain the word "beta" |
History Does Not Contain Words beta
|
Items that contain the phrase "stack traces" and were closed but reactivated |
History Contains Words stack traces And State Was Ever Closed And State <> Closed |
Items closed within a specified time period |
State = Done And Closed Date > 7/1/2015 And Closed Date <= 7/21/2015 |
Items I've been associated with |
History Contains Words MyName Or Assigned To Was Ever _ |
- Type the complete word or phrase that is specified in the History field of those work items that you want to find.
- Enter the full text for the word that you want to search. The History field is indexed for full-text search. If you enter only a partial word, the query will not return work items that contain the full word. For example, if the History field contains the phrase reproducible behavior and you search for repro, the work item will not be found. However, if you search for the complete word reproducible, the work item will be found. You can also search for the string with a wild card, such as
repro*
. - The query editor ignores common words or stop words as defined in Configure and Manage Stopwords and Stoplists for Full-Text Search.
- On the query editor toolbar, choose
or
icon and confirm that your query returns expected results.
- If you don't receive the results you expect, adjust the word or phrase that you entered, and run the query again.
An entry is made to the History field each time a work item is saved. To view the history of changes, open an existing work item, and then choose the or History tab, or for some work item types, choose the Details tab.
::: moniker range=">= tfs-2017"
The state change history diagram appears first. To see the entire history of state changes, choose Show all.
Choose an entry in the left pane to view the details of changes made.
::: moniker-end
::: moniker range="tfs-2017"
Note
With TFS 2017 and later versions, the History field is no longer a rich-text field. To annotate the work item history, add to the Description or Discussion fields. ::: moniker-end
::: moniker range=">= tfs-2013 <= tfs-2015"
To view only the comments that were added to the log, choose the Discussion Only tab. To view all changes made to the item, choose the All Changes tab, and then choose the show all changes link for a specific date and time.
::: moniker-end
To view only the comments that were added to the log, choose the Discussion Only tab. To view all changes made to the item, choose the All Changes tab, and then choose the show all changes link for a specific date and time.
You can use the following fields to filter queries and create reports. Several of these fields are populated with information as a work item progresses from one state to another. Other fields update when the work item is modified. Some fields don't appear on the work item form, but they are tracked for the WITs listed.
Field name | Description | Work item type |
---|---|---|
Changed By |
The name of the team member who modified the work item most recently.
Reference name=System.ChangedBy, Data type=String |
All |
Change Date |
The date and time when a work item was modified. Reference name=System.ChangedDate, Data type=DateTime |
All |
Closed Date 1 |
The date and time when a work item was closed. Reference name=Microsoft.VSTS.Common.ClosedDate, Data type=DateTime |
All |
Created Date |
The date and time when a work item was created. Reference name=System.CreatedDate, Data type=DateTime |
All |
History |
The record of changes that were made to the work item after it was created. Every time that the work item is updated, information is appended to the history, which specifies the date of the change, who made the changes, and which fields were changed.
History field queries return work items whose Discussion comments or Description fields contain words that match the keywords entered. You can't use the History field to query on changes made to other fields. You can't add formatted text to the history field. Once you've saved the work item, you can't alter the history. The Reference name=System.History, Data type=History |
All |
Resolved Date 1 |
The date and time when the work item was moved into a Resolved state. Reference name=Microsoft.VSTS.Common.ResolvedDate, Data type=DateTime |
Bug (Agile, CMMI) |
Rev |
A number that is assigned to the historical revision of a work item. Reference name=System.Rev, Data type=Integer |
All |
State Change Date |
The date and time when the value of the State field changed. Reference name=Microsoft.VSTS.Common.StateChangeDate, Data type=DateTime |
All |
Test Suite Audit |
Tracks additional operations performed when modifying a test suite, for example: adding tests to a test suite or changing configurations. This field can be viewed through the History tab or through a separate query. There will be a consolidated history view, including changes performed to work items field and changes resulting from related artifacts such as test points and configurations. Reference name=Microsoft.VSTS.TCM.TestSuiteAudit, Data type=PlainText |
Test Suite |
Watermark |
A system managed field (not editable) that increments with changes made to a work item. Reference name=System.Watermark, Data type=Integer |
All |
-
For these fields to be defined for a WIT, they must be included in the
WORKFLOW
section of the WIT definition. For example, this syntax is included within theFIELDS
definition when transitioning to a Resolved state:<FIELD refname="Microsoft.VSTS.Common.ResolvedDate"> <SERVERDEFAULT from="clock" /> </FIELD>
[!INCLUDE temp]