I am trying to build a tfs query, which will return only the topmost items that are assigned to me. Examples:
- UserStory (US) is assigned to me and contains tasks that are assigned to me => query returns only the US
- US is assigned to someone else, but it contains tasks that are assigned to me => query returns the tasks
- US is assigned to me, but tasks are assigned to someone else => query returns the US
I struggling to figure out, how to access the parent of a task or maybe this isn't even the right approach. I am working with VS and TFS 2010. Ideas?
[EDIT] Another idea would be to write a wiql query, that finds all items assigned to me and than checks if the link has some properties, but iam not sure about that. In TFS2013 there supposed to be something similar ("match top-level workitems first"), unless this is just a sorting option.
This is not possible with one query, at least you need 2, because you can't combine link filters with parts of a query:
The first query will just list all User Stories assigned to you, no matter if something is linked or not. The second query will list all Task that are assigned to you, but have no UserStory linked that is assigned to you.
[EDIT]
Another option could be to combine both queries, but I can't test it in my environment:
This will list all User Stories and Tasks that are assigned to you, but have no parent User Story linked.
[EDIT2]