In TFS how do I pull all the items that were assigned to me between certain dates in the past? - tfs

I am trying to figure out the way to pull all the items that were on my plate between certain dates. Is this possible? Could you please help me to figure out how to write a query for that? Thanks.

The best that I know how to do is to set 'Assigned To' Was Ever #Me, then manually scan the list of work items returned (setting other fields as necessary to filter the results). In the UI, at least, there isn't a way to query on historical data.

You can do this via query window as well, below is my query that i use to see what have i been working on in the past two sprints.
This will give you any tickets you worked on regardless of who they are currently assigned to (system test / uat or whatever).
You can add more clauses and have Changed Date > xxx AND ChangedDate < xxx to find what you are looking for in any given dates.

Related

Find WorkItems that were assigned and finished in the last 30 days

I would like to see a list of workitems assigned to a particular person. I would also like get information about when those workitems were completed. Is there any column like assigned_date and finished_date that i could use?
I saw [Status]='AssignedTo' but didnt find anything that says when it was assigned and when it was finished
This link provides some info that I am looking for but not everything.
You could use the operator “Was Ever” that searches for a value in a field in the history of Work Items. Such a query will return all Work Items you were/someone assigned to, even if now they are assigned to a different person.
However, there is not any assigned_date and finished_date you could use. Several date and identity fields are set based on workflow states or transitions. You could find all
Date and Iteration Path fields here.
You have to use Revisions - List Rest API to return the list of fully hydrated work item revisions and fetch the work item assigned and finished time. Finally check if they are in the last 30 days.
GET https://dev.azure.com/{organization}/{project}/_apis/wit/workItems/{id}/revisions?api-version=6.1-preview.3

Update several Tbl Fields based on Start/End Dates

Good day to everyone! Hope all is well!
I am looking to run an update query or a group of queries that looks at my Date_Start and Date_End to determine if the Units (quantity of the respective record) fall in my defined current quarter 1/2/3/4 from another table (this table is a master table I’m using to provide the dates that I need to consider for defining the quarters).
I’ve been able to create queries that do this and then join them together to basically display the units out by quarter based on their respective start/end dates. The problem I am running into is this process takes a decent amount of time for the queries to populate that will drastically effect other processes down the line.
Thus we get to my desire. I am trying to no avail to create an update query that will update the quarter fields in my table based off of the queries I built to determine if the records start/end date fall in the respective quarter. I figure that running this update when records change will be an ok run time vs when I’m running reports or running an email script for the reports.
I have tried pulling in the table and query, joining them as equal on ID (the query pulls in the table's IDs), and selecting my field “CQ1” from the table, and setting the Update ether the respective field from the table or the query (which is the same as the field in the table).
All I get are the current values of the field in the data sheet view and an error of “Operation must use an updateable query.”
I have even tried placing a zero to see if that would do it with no luck. I have verified that all the fields are the same data type.
What am I doing wrong? Thanks!
Apologies to everyone.....I think my conscious brain was trying to overly complicate the process and while talking to a buddy about my issue distractedly created a new update query that worked. It all tied down to that I forgot to put a criteria on my quarter filed of is not null I believe. Thanks for anyone that has read this and is responding while I’m typing this or for those of you formulating a response.

How to get TFS query result but for a previous date

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.
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
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:
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

Is there a way to find the deleted transactions by list Id?

My goal is to find the deleted transactions during a period of the time for a list of jobs. The period of the time can be different from job to job. I am currently using TxnDeletedQueryRq but the request only provides filter on date range. I tried to look into other requests, but no luck so far. I am wondering if anyone knows a way to achieve this.
Thank you.
The only way that I can think of would be to create an audit trail report and parse for the state "Deleted". This allows you to set an entity filter for the name, plus you could set the modified date range an the report period to maybe help narrow down the information you would need to parse:
IGeneralDetailReportQuery report = MsgRequest.AppendGeneralDetailReportQueryRq();
report.DisplayReport.SetValue(false);
report.GeneralDetailReportType.SetValue(ENGeneralDetailReportType.gdrtAuditTrail);
report.ReportEntityFilter.ORReportEntityFilter.FullNameList.Add("Customer");
report.ORReportPeriod.ReportPeriod.FromReportDate.SetValue(fromDate);
report.ORReportPeriod.ReportPeriod.ToReportDate.SetValue(toDate);
report.ORReportModifiedDate.ReportModifiedDateRangeFilter.FromReportModifiedDate.SetValue(fromModDate);
report.ORReportModifiedDate.ReportModifiedDateRangeFilter.ToReportModifiedDate.SetValue(toModDate);

Find WorkItems that were assigned to X in the last 30 days

I'm trying to find all WorkItems that were assigned to a person X in the last 30 days.
The big problem I have is the "in the last 30 days"-part.
I thought about using the "ever" or "asof" keywords, but couldn't find a good answer yet.. something like WHERE [Assigned To] = 'X' AND (([Assigned To] != 'X') asof '<30daysago>').
But this is still not a bulletproof solution.
Any better ideas?
Thanks & kind regards
Simon
It appears that this is not possible using just WIQL, but you can get close.
The keyword #Today will give you today's date, then just subtract your range from it. The EVER keyword applied to [Status]='AssignedTo' and a comparison against a date 30 days in the past to [StateChangeDate] is what you'll need to accomplish this.
As close as you can get with WIQL and existing fields:
This says, from all revisions (status changes) return records where the user 'X' has ever been AssignedTo and the State has changed in the last 30 days. This will basically give you a slightly fuzzy picture of what your User has been working on in the last month.
WHERE [Microsoft.VSTS.Common.StateChangeDate] >= #today - 30
AND [System.AssignedTo] EVER 'Bennett Aaron'
ORDER BY [System.State]
Add the missing field:
You could add a custom field called AssignedDate that is captured during the New->AssignedTo workflow transition that you create in the Work Item Definition XML. You can accomplish this using the Team Foundation Server Power Tools extension to Visual Studio. This would give you exactly what you need as well as additional reporting options going forward.
TFS API
I cannot help you with this one, but I believe you could query using the TFS API.
A couple of quick gotchas I've experienced to save you time on ASOF and EVER:
AsOf won't help you by itself with this as it does not support a range of dates. It allows you to query as if it were another date. In other words, if you forgot to capture the results of a query yesterday, you can use an AsOf query to get the results that you would have gotten had it run yesterday. What I understand is that you want to query a basic date range.
EVER might not work as you expect against dates as I believe it uses the exact value of the field (timestamp portion of the date field would be included) it tests with. Just make sure the EVER keyword is used against the status field rather than a date.

Resources