TFS 2013 query bugs under PBI count - tfs

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.

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

TFS2012 User Storys Tasks with different iteration paths

In my Company we are using Team Foundation Server 2012 and Agile as Project Template. We are still learning how the Board and the Backlog show Tasks within User Stories and I realized that "Orphan" Tasks are not shown in these cases...
I made an query to solve the problem about the "Orphan" tasks but I realized that the same issue is happening when a User Story and a Task have, for some reason (maybe someone assign it to a User Story after creating it), a different iteration path... the tasks are not shown in the Backlog or Board.
Is there an automatic way to make tasks having the same iteration path as their parents? How can I make a query to show tasks whose User Stories have a different iteration path as them?
Thanks a lot in advance!
Well. After more researching I have realized about two thing:
- It is not needed to do this in order to show the Tasks in the Board/Backlog because, if the User Story contains tasks that are defined in different iterations, the User Story will be shown in the different iterations, repeated, but only with the tasks belonging to the iteration.
- If someone still wants to create the query, maybe to reunite User Stories, the solution is creating a new Query of the type Work Items and Direct Links and change the following parameters:
* In Filters for top level work item Add a new clause And Iteration Path = IterationA
* In Filters for linked work items Add a new clause And Iteration Path <> IterationA
* In Filter options Types of links select Return selected link types and check Child and Parent.
Unfortunately there is no way, so far I know, to do it automatically for all iterations so you have to do a Query of this type for all iterations.

Query tfs workitems where user is assigned work item or linked work item (in 'tree of work items')

We are using the agile template, and have user story's with linked tasks.
Some user stories assigned to me and some tasks, for users stories, are assigned to me.
What I'm trying to get is all work items that are assigned to me, or work items where a linked work item is assigned to me in a tree of work items view (not flat list)
So right now I have:
any work item in this project and iteration (not closed\resolved, and not a bug)
AND
any linked work items assigned to me (not closed\resolved)
But this returns user stories, where I don't have tasks assigned to me. But if I change the first part of the query to be filter out items not assigned to me the 'Tree of Work Items' is not show for where I only have tasks.
The output I would like would exclude user stories where I don't have tasks, and include users stories where I do... something like this:
User Story 1 --> team member A
---->Task 1a --> me
User Story 2 --> me
---> Task 2a --> team member B
Any ideas what the query would be?
Thanks
What you want is not possible in one single query. The filter you do on the parent and on the child will be combined to an "AND" filter operation.
To get only the parents for which you have tasks, choose the query type "Work Items and Direct Links" and in the child section add a filter on "assigned to = #me" and select the option "Only return items that have specified links".
Seems like that has been improved as of TFS 2012.
You can have a Tree of Work Items, where your linked work items are filtered according to your preferences (assigned to me, not closed, iteration etc.)
Then make sure to add "Filter options" -> Match lined work items first -> Parent/Child
That should filter any parents, not having sub tasks assigned to you and other filters you applied.

Is there a TFS query macro for the current iteration?

Is there a way in TFS in VS2010 to specify that a particular iteration is the current one, and then return that for use in queries similar to the way #Project works? If not is there a way to do sub-queries in TFS work item queries?
Looks like Microsoft listened. #CurrentIteration is being added as a token.
That’s great, of course. When looking to write a query against the current sprint, however, you are in danger of losing sight of unclosed work items in previous sprints. When you reach for #CurrentIteration, you probably just mean “all unfinished work that has been committed to a sprint.” If you filter to a single sprint, you’ll miss any stragglers you failed to close or move forward from previous sprints.
Consider using the following pattern, where “ScrumOfScrums\Release 1.0.0.0″ is your backlog path, and all of your sprint paths are children to that:
Filter for work items under your backlog iteration node, but not equal to the backlog iteration node. That will give you all items committed to a sprint.
This will also catch any items that weren’t closed in your previous sprints. Since the goal is to close every item in a sprint before moving to the next one, this query pattern will generally be better than using #CurrentIteration, unless you're looking to find the closed items in the current iteration.
P.S. While this is an old question, it was my top hit when I searched for info on querying the current iteration in TFS.
I'm afraid that there is not such a macro. I personally just have a few "X in current iteration" team queries and then edit those queries to point to the new iteration path at the start of each iteration.
I am going to try using a standard name for the current iteration such as 'Current'. The queries for this iteration would all reference this name. Once the iteration is completed, I will rename it using a naming convention that includes the date for example and the next iteration would then be created with the name 'Current' (or renamed to this if it already exists). The queries would then return results from the new iteration.
- 2010-49
- Current
- 2010-51
I am not sure whether renaming iterations this way will cause any conflicts or confuse the data warehouse for example but this would save on having to create or modify a heap of queries at the start of each iteration.
I would be very interested to hear feedback on this approach!
Query for Sprint in a date interval as shown here:
Team Project = #Project
And Work Item Type = Sprint
And Start Date <= #Today
And Finish Date >= #Today
I have found that Telerik's free Work Item Manager provides an elegant solution to this problem.
Just define your queries as you usually would but leave out any filters relating to iterations (note that this also applies to areas). There is a treeview pane named 'Area/Iteration Filters' that will add extra, recursive filtering based on the iteration (or area) that you select there.
Note that if the pane is not visible then you can enable it via the View menu.

Resources