0

Is it possible to execute a TFS query and get the results not for today but for a previous date?

I just want to see the results that were available in that date.

To clarify: I need to see the state of the work items on a give date to see their evolution over time.

4
  • using code and WIQL you can use an AS OF operator, sorry, I currently don't have a link or sample. So please can anyone hijack this comment and create a proper answer that is worth being posted ;)
    – eFloh
    Dec 1, 2015 at 15:59
  • Well, thanks for trying anyway :) I though this was something easy to achieve. Do you mean I will have to code my own tool? Dec 1, 2015 at 16:02
  • I'm not sure when it was made available but certainly in later versions of TFS you can use the @Today token and you can subtract days. e.g. @Today - 7 for items as at last week. Not sure if that will help you as you would obviously need a date condition in your where clause.
    – Rodders
    Dec 1, 2015 at 16:23
  • @Rodders: the @today will be usable in queries like WHERE ChangeDate > @today -3 but will not help if you want to find workitems WHERE title='banana' AS OF '1.12.2014' when the title was changed later. (even if for that case, the WAS EVER operator will be sufficient). @Ignacio: Can you edit your question, so that it states what you want to achieve, so that others may be able to answer with an appropriate workaround?
    – eFloh
    Dec 2, 2015 at 10:08

2 Answers 2

1

According to your clarification, you need see the state of the work items on a give date. There is not a direct way to achieve it in Work Item Query.

You can only use Was Ever in Work Item Query to list items based on State past assignments, like:

state Was Ever Active

Or you can use State Change Date <= YYYY-MM-DD and State Change Date > YYYY-MM-DD to list all work items that changed State on YYYY-MM-DD. (Need to check whether TFS 2010 has State Change Date field)

Of course you can combine other clauses to narrow down the query.

What you want is actually the work item history. You need to get the work item history programmatically using TFS API. You can check this blog below to use the API:

http://www.codeproject.com/Articles/243653/TFS-SDK-Work-Item-History-Visualizer-using-TFS-API

4
  • I normally work only with TFS Explorer. How can I execute a query like this? Dec 2, 2015 at 8:07
  • Could you try ChangeDate <= YYYY-MM-DD? Also, if you want to query a state, you can use "State" "Was Ever" "xx" clause? Dec 3, 2015 at 7:16
  • By the way, could you provide an example that you want to achieve, so that we can try the clauses to see whether the default query can achieve your requirement? Dec 3, 2015 at 7:32
  • How can I execute the query? Dec 3, 2015 at 7:50
0

I think you can create pivot table report to connect to TFS cube. For your requirement to see work items' evolution over time, you can define the pivot table as:

enter image description here

Check these two links for the details: https://msdn.microsoft.com/en-us/library/ms244678 and https://msdn.microsoft.com/en-us/library/ms244710.aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.