Search code examples
tfstfs-workitem

Query TFS based on value change of a field


There is any possibility in TFS UI to query based value changed of a field? E.g.

Query all work items which have changed Automation status field to "Automated" in the past 2 days.


Solution

  • If the Automation status field reference the System.State (reference name), then you can try below query: enter image description here

    If the filed doesn't reference System.State, then we cannot achieve the requirement.

    However you can custom a field and apply rules for the field to copy the value of State Change Date, something like this :

    <FieldDefinition name="test" refname="test.date" type="DateTime">
      <WHEN field="Automationstatus.xxx" value="Automated">
        <COPY from="field" field="Microsoft.VSTS.Common.StateChangeDate" />
      </WHEN>
      <HELPTEXT>test</HELPTEXT>
    </FieldDefinition>
    

    Thus when you change Automation status to "Automated" for a work item, the changed date will be copied to the test filed. Then you can use the test field to filter the work items in future... but it's not available for current work items.