TFS query for tasks with no parent - tfs

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.

Related

Query children of a predecessor in TFS

I'm working in a project with a huge backlog, which structure is defined and can't be changed anymore.
In our Work Breakdown Structure (WBS) we have several epics and their user stories defined. For project reporting purposes we do have "checkpoints" defined.
Each checkpoint has a bunch of epics as predecessors. So only if we have completed all epics, we can pass the checkpoint.
In TFS 2013 I do have a query to display all checkpoints. Checkpoints are a PBI with the title [Checkpoint]. In this query, I get also the predecessors (epics) for this checkpoint.
Now I would like to get all children of these epics (e.g.):
[Checkpoint]"Infrastructure ready"
-Link Type "Predecessor": [Epic] "Set-up TFS"
---Link Type "Child": [Story]"Request project in dev-ops"
---Link Type "Child": [Story]"Set-up Build Environment"
-Link Type "Predecessor": [Epic] "Set-up Development Environment"
---Link Type "Child": [Story] "Create Docker-Container"`
Currently, I'm only able to query for the checkpoints and their predecessors. I'm struggling to get the children of the predecessors in the same query.
Adding a picture of the current situation:
Query with missing children
In the picture, you see that the children of the [Epic] PBI's are missing.
If you mean that you want to list all the Parent and Child work items, then you can create a type of query : Tree of work items. Reference the first screenshot for detials:
If you want to get the Parent and Child work items for a specific work item, then you can create a type of query: Work items and direct links. Reference the second screenshot for details.
UPDATE:
We can not get all work items with their parent and child work items in one query. You can try to specify the specific work item ID in Work items and direct links query, just as the example in my answer, Then you can get the three level work items related to that specific work item. We can only do this with the query, you may want to get all related work items with the three level, but unfortunately that's not supported.
You have to set-up several queries or have different ID with an OR-Query, that shoule works.

TFS Tree Query contains unexpected linked items

I created a TFS Query which works fine if runs as simple flat list query, there are no Terminated items as expected. Note that the brackets [] indicate the grouping.
Team Project = #Project
[ And Work Item Type = Epic
Or Work Item Type = Improvement ]
And State <> Terminated
[ And Iteration Path Under A\B1
Or Iteration Path Under A\B2 ]
Now I want to use this as a query for linked items within a tree query though. In this case I get linked work items in the state Terminated even though I explicitly exclude them in the query. Why is this?
I can imagine that this may be the case due to the children not being terminated, however I still would expect them to be filtered, because in a flat list they are filtered as well.
Which filtered option you select in your query. To find linked children, select Match top-level work items first. To find linked parents, select Match linked work items first.
You can also achieve that result by creating some custom code that uses the tfs api to execute two queries (parent/children) and intersect their results.

Visual studio online query items without tags

When are working with various Work Item types (user stories,Tasks, etc) we assign tags to reference the area of work. This makes it easy to filter the Backlogs items view to find any related stories.
I would like to build a query to identify Work Items where the tags have not yet been assigned.
I know this can be achieved using excel and filtering, however I specifically would like to do this using the queries. Is this possible??
Thanks in advance for any assistance.
Firstly, I have to say that it is not possible to create work item query to show work items which don't contain tags. As you see that the Operator for Tags is Contains or Does Not Contain, it is not possible to use these two operators to filter out these non-tagged work items.
Secondly, as you have more than 100 tags, it is not an effective way to use "Does Not Contain" operator to exclude all tagged work items.
So,
How about you adding a 'Null' tag to all non-tagged work items to specify that these work items don't have any tags? With this approach, you can create a work item query with Tags Contains Null to list these non-tagged work items.
If you don't want to take this approach, you need to work with excel just as you mentioned above, or take Dave's advice to work with API.

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.

Find all bugs without test cases

We have had a bunch of bugs input into TFS, but we are looking to build a query that will return all bugs that haven't been lined to a test case.
Anyone know how I would get that bug list?
Thanks,
Chris
You should be able to retrive these with a linked query:
Select New Query...
Select type Work Items and Direct Links (instead of Flat List)
Select Bug as the main work item type, and any other criteria you may need
Select Test Case as the type under Filters for linked work items
Finally, select Only return items that do not have the specified links

Resources