Cannot achieve that with the query by default.
But you could query the work item history with the TFS API and check the timestamps on when the state transitions occurred.
Refer to this article to do that : TFS SDK: Work Item History Visualizer using TFS API
You can also use the REST API to extract the dates that a Work item changed state.
For example, you can use below PowerShell sample to get the date changed to "Committed":
Param(
[string]$collectionurl = "https://instance.visualstudio.com", #If on-premise TFS change it to http://server:8080/tfs/DefaultCollection
[string]$workitemId = "62",
[string]$user = "username",
[string]$token = "token"
)
# Base64-encodes the Personal Access Token (PAT) appropriately
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $user,$token)))
$baseUrl = "$collectionurl/_apis/wit/workitems/$($workitemId)/revisions?api-version=1.0"
$response = (Invoke-RestMethod -Uri $baseUrl -Method Get -UseDefaultCredential -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)})
$revisions = $response.value.fields | where({$_.'System.State' -eq 'Committed'}) # Change the sate which you want to get it's changed date here
$witrevisions = @()
foreach($revision in $revisions){
$customObject = new-object PSObject -property @{
"WorkItemType" = $revision.'System.WorkItemType'
"CommittedDate" = $revision.'System.ChangedDate'
"ChangedBy" = $revision.'System.ChangedBy'
}
$witrevisions += $customObject
}
$witrevisions | Select-Object -Last 1 `
WorkItemType,
CommittedDate,
ChangedBy
