Is it possible to limit a TFS query to top 100? - tfs

Using TFS (hosted), I'm trying to create a query to show some stats about the top 100 product backlog items.
I can add a condition to filter by the "Backlog Priority" field, but these numbers are arbitrary and the query would require constant manual updates. I want to filter by backlog position (called "Order" in the Product Backlog view).
I have tried saving a .wiq file from the query editor, manually adding TOP 100, and reopening the .wiq file. I get the error "TF51006: The query statement is missing a FROM clause. The error is caused by «100».
Is it possible to accomplish this through the TFS website? If not, is it possible to create this query in WIQL and save it to the server?

Related

TFS query to show all tasks by assignee

I'm trying to create a view in TFS where I can see all tasks for the current Sprint by assignee. Preferably be able to expand and collapse each Assignee's section to reduce vertical scrolling. I don't see a way to create a Tree query with the Assignee Name as the parent and the tasks as children. It looks like the basis is always a Story. Is there a way to do this?
I know I can look at the Board view and filter by assignee but, that's a lot of clicks and scrolling.
You can create a chart for your query. This will allow you to break the query down into assignees.
There is no group by option in Work Item Queries.
You can only 'group by' work item type in tree and relation based queries. You'll need to resort to Excel to do the filtering or use PowerBI.

Default Stack Rank

When a business user enters a new work item (in TFS 2015, using the Agile template), it appears the ticket is inserted into the list of tickets based on where the user has selected (see screenshot).
We have a bi-weekly meeting to prioritize tickets and it appears stakeholder users are able to create items at the top of the list. If I go to the list to get the next item to work on I very well might select an unvetted item instead of one that has been prioritized by the council.
Is there a way to default the stack rank (ideally bottom or middle or something)?
I've tried to create a field rule in the work item type definition so that when a new item is created the field Microsoft.VSTS.Common.StackRank has a static value COPY into it of 2,000,000,000. The stack rank was defaulted but the order was still first.
I know I could update the workflow to accommodate (e.g. new state "New (unvetted)", new custom field IsVetted, etc.) but wanted to see if there was a automated way before handling manually.
Sorry this is impossible, as you have said the sequence of items on the backlog page is determined according to where you have added the items or moved the items on the page. As you drag and drop items within the backlog list, a background process updates this field.
Stack Rank
A number, usually assigned by a background process, used to track the
list order of items on a backlog or board in the web portal.
Reference name=Microsoft.VSTS.Common.StackRank, Data type=Double
You can't sort your backlog on a column. If you want to view a sorted listed, click Create query, save and open the query, and then sort the query results. To learn more about queries, see Use the query editor to list and manage queries.
Take a look at below related threads:
Backlog priority or stack rank order
Move items into priority order

TFS 2013 query bugs under PBI count

I have a PBI to collect all show-stopper bugs and display them on the SCRUM board.
(actually, I have one parent PBI like that, and 3 child PBIs - one per each team).
I want to display the bugs count in the home page of my project, either as 3 different squares, or as a pivot table by PBI.
For example, I created "work items with direct links" query, which returns the PBI and 2 bugs under it. but when i pin this query to my home page, it displays the count "3" (1 PBI + 2 bugs). I want to display only the children count.
How can I do it?
Thanks,
Annat.
Pinning a query to the home page is just going to show the number of Work Items returned by the query regardless of hierarchy.
Work Item Charting (for your pivot table) only works with flat queries (rather than direct link or tree queries) so that isn't going to work in this scenario.
Could you use another way to indicate the showstoppers such as AreaPath or Tags and that way you could return the information in a flat query?
I prefer not to have nested PBIs on the backlog anyway as it means the child items can be prioritised independently.

TFS query for tasks with no parent

I would like create a Flat list of work items query in TFS in which the results contain all of the specified PBI and Bug cases and any Task cases that have no parent.
It's that Task with no parent part that has me perplexed. I cannot see a way that I can do what seems so obvious such as (Parent Link Count = 0) because that attribute is not exposed to me though, strangely, some other link type counts are.
Any ideas?
You need to change the type of your query to the Direct Links query, then choose the option to pull back all work items without any matching links. The results will still be a flat list.

TFS 2010: Real time reporting

I would like to create a report that shows the iteration status in real time. I was able to create a query on the Tfs_Warehouse database (see below) however I found that this database is populated from the Tfs_Collection database on timely basis.
Is there a way that I can see the changes to the work items reflected in the report right away?
SELECT *
FROM [CurrentWorkItemView] c
left join [vDimWorkItemTreeOverlay] t on t.WorkItemSK = c.WorkItemSK
where c.IterationName = #iteration and c.System_WorkItemType = 'User Story'
order by c.Microsoft_VSTS_Common_StackRank, c.System_id
Note: this not the full query because I couldn't fit it nicely. Basically it joins 2 table (CurrentWorkItemView and vDimWorkItemTreeOverlay) to get the user stories and associated tasks to each user story.
No, not through the warehouse. When you need up to date information from the work items, use a work item query in Excel or Visual Studio.
You can also use the TFS api to query the operational datastore directly.

Resources