In a previous incarnation I was able to query the TFS Data Warehouse using SQL, which gave me the ability to generate much more sophisticated queries than the TFS query editor and WIQL provided.
I've recently started working in ADO instead of TFS, and I'm wondering if ADO provides any equivalent kind of querying capability on the back end, as opposed to the limited capability that the ADO query editor and WIQL offer.
Any suggestions?
You can use Analytics Views and Power BI to get way more information than before about Work Items in your instance. You do get Analytics view in Build/Release/Tests as well, but you can't get them from Power BI.
Analytics Views
Related
We are trying to calculate efforts of a User across different projects in the same collection of TFS 2018.3 and Azure DevOps Server (ADS). Is there any possible way to achieve this scenario in TFS/ADS and do we have any official extension from Microsoft or third-party extensions to calculate this?
Thanks in advance
No, there is not a build-in way to sum up the effort or story points across projects.
Support for calculated fields and roll-ups which is still a user voice at present.
As an alternative, you could implement a server side plugin for TFS or create a Web Service that subscribe to TFS Events, then in your code you will use TFS API for the Client Object Model (Work Item Tracking) to get the needed work-items and user info, calculate and save the data to somewhere.
Another solutions is an 3rd-party TFS Aggregator extension for Team Foundation Server (TFS) that enables running custom script when Work Items change, allowing dynamic calculation of field values in TFS and more.
Besides you could also export the query to Excel, and sum the completed work column in Excel.
All above is for a single project, you need to count them for multiple projects finally.
I need to extract some data from TFS data base and I can't find the tables that I need.
We using TFS for measure productivity (projects, user stories, tasks, etc) and I must do an productivty indicators with Excel connecting directly to TFS data base indicating the effort time by user and task.
I have the memberships table but no the relations to workitems/task and the effort time
SELECT * FROM [ADObjects] where ObjectCategory = 2 order by DisplayName
Version of TFS 15.117.27024.0
EDIT
Ok, I finded the way to access the data that I wanted with a sql query:
SELECT o.SamAccountName as Usuario
,MAX(Microsoft_VSTS_Common_ClosedDate) AS Fecha
,[WorkItem]
,SUM([Microsoft_VSTS_Scheduling_CompletedWork]) as Horas
,MAX([System_Rev]) AS UltimoMovimiento
,System_Id as WorkItemId
FROM [tfs_warehouse].[dbo].[WorkItemHistoryView] wi
join [Tfs_OurDomain].dbo.ADObjects o on o.DisplayName = wi.System_AssignedTo and o.DomainName = 'DomainName'
where System_State = 'Closed' and System_WorkItemType in ('Bug','Task') and System_AssignedTo is not null
and o.SamAccountName = 'MemberName'
and Microsoft_VSTS_Common_ClosedDate between '20180501' and '20181101'
group by [WorkItem],o.SamAccountName,System_Id
order by o.SamAccountName asc
Querying directly against the TFS_*Collection databases and the TFS_Configuration databases is not supported. The schema can change between even minor updates and breaking changes have occurred in past releases at regular intervals. Running queries against this database may negatively impact the performance of your TFS installation.
To support reporting TFS has shipped with a Reporting capability. The TFS Warehouse (if enabled on your installation) contains most of the data you're looking for in an easy queriable format. These warehouse tables contain a more limited set of data and the schema is kept the same within major releases and hasn't changed much even between different major releases. The process hasn't changed since it's introduction but the functionality is on it's way out when the Azure DevOps Analytics Service is available for on-premise TFS installations. This will expose the data through an ODATA feed.
The analytics service is currently forecasted for TFS 2019:
Analytics - Available for Azure DevOps Server Reporting 2019
If the Warehouse Cube isn't available for your TFS installation, you can use the TFS REST API's to query all the data you're after. The following API's will give you access to the data you need:
Query Work Items Revisions for Reporting.
Query Work Item Links for Reporting
Map work to teams
Query teams & team members
Excel can be extended through .NET and using that functionality to query the REST API you can then use the .NET Extensibility in Excel to populate lists in excel with the data from these REST APIs and drive your reports from those lists.
I've been asked to take a bunch of saved TFS Work Items > Shared Queries and reverse engineer them as SSRS reports for more elegant dashboarding.
For all of these I can right-click > Query Editor and it will take me to the Query Editing GUI, which has drop-down list for fields, but I'm not seeing any functionality that allows one to view the underlying WIQL query against the TFS_Warehouse (I'm assuming) database.
Question: Is there a way to get the underlying WIQL for a given TFS Shared Query?
I've done some searching on my own, and am finding multiple pages related to writing your own, but none where you can get the pre-existing for a shared query.
To get the underlying WIQL you can use File-Save as
Pick "file" as target option:
To create a warehouse query use the new report option in the Team tab in Excel. That will allow you to select a work item query which will be turned into a report.
See:
https://jessehouwing.net/vsts-tfs-generate-work-item-query-for-tfs-api/
In Team Foundation Server (TFS), currently I am able to query the work items (bugs, tasks) by #CurrentIterationPath and status (closed etc.). But I am in need of fetching all users who worked today and the number of hours they logged. Could anyone out there help please?
I am using tfs 2015.
CAVEAT what you ask is a bad practice and I always advise against. TFS is not a time entry tool: it is designed to support development team in being agile not to support accounting! If you need that there are tools that extend/integrate with TFS, designed for that purpose.
That said, there is no OOB report, query or API that will extract similar information.
A possibility is to use an Excel Pivot Table that reorder the export of a WIQL query. See here and here for Excel integration with TFS.
Another path is to write a SSRS custom report but I doubt it offers all data you asked for and it is a non trivial exercise IMHO.
Thinking in user stories, my requirement would be:
As a development department manager, I want to get the full list of iterations by team project, in order to have a full view of the milestones set for all the teams.
My initial approach is a query to the database. Which could be a good approach to build this query?
Is there another way to get it?
Querying the TfS operational store directly is unsupported and can lead to your system being unsupported. You should use the reporting tools instead.
TFS creates a data warehouse and cube where all the information is stored for reporting purpose's. You can just plug Excel into the data warehouse a query tye data that you need. If you want trend analysis you can also query the cube.
http://msdn.microsoft.com/en-us/library/bb649552.aspx
If you have team explorer installed you can also retrieve work items from queries to the operational store through the API. Any query that you can get in TFS you can load into excel.
http://msdn.microsoft.com/en-us/library/ms181675.aspx