Search work item history - visual-studio

Is there a way in Team Foundation Server to search in the work item history? For example, using the query editor you can add the expression "AssignedTo=PersonName" which fetches all tickets assigned to that person. But how would you setup a query so that it fetches all tickets that has ever been assigned to that person, even if the current assignee is someone else?

You need to use the Was Ever operator in your query:

Related

Query to find order products for related accounts in Dynamics CRM

On the Accounts form, I want to be able to show all Order Products for that Account and any related Account. My aim is to give the user an easy way to see what has been bought by a customer with several related offices (Accounts).
Any idea how this can be done?
There is a way to do this with a plugin. The general steps would be:
Ensure the view that is used on the order product subgrid on the Account form is not used anywhere else.
Make a unique change to the view columns or filter criteria that will let you distinguish it from other views. For example, you could add a condition of "createdon contains data", which most likely would not be used anywhere else
Create a pre-RetrieveMultiple plugin on Order Product.
In the plugin, get the query from the input parameters and check for the "createdon contains data" condition. If it does not exist, exit the plugin.
If the condition exists, this is the view you want to update. In the query, find the condition that has accountid.
Use the accountid to retrieve related child and parent accounts.
Update the query with a condition checking if accountid is in the list of all the accountids you retrieved.
The query should now return all the relevant order products and display them on the Account form.
This is a rather involved solution with only the high level steps outlined here.
Here is a link that shows an example of modifying a query in a pre-retrievemultple plugin:
https://hachecrm2011.wordpress.com/2013/07/19/filtering-views-by-intercepting-retrieve-multiple-queries-with-a-plugin/

How to create a quick search in CRM that spans multiple entities with grouped conditions

We are a housing association with a large CRM system (2016 & SP1). We have a new requirement that requires our users to be able to search for people who are current (ie not previous) occupants or residents or who are not residents (eg contractors)
For this purpose, we need to search the Person entity which has a related Tenancy entity. Person has TenancyType field with possible (option set) values Occupant, Resident, Contractor. Tenancy has TenancyStatus field with possible (text) values Current and Previous.
We tried using the following filter criteria in the quick view on the Person entity:
thinking that it would return all people who are not previous residents. However we noticed that it would filter out contractors because contractors do not have related tenancy records.
We needed to change the criteria to return all contractors OR all residents and occupants with no previous tenancy. So we changed it to the following:
at which point we got stuck because we noticed that it was not possible to AND together the second and the third conditions as the third one is a related entity.
We are wondering what the best way is to achieve the above bearing in mind that we do not want a separate view for each condition, eg one for residents, one for none residents, etc.
Any help or suggestion is greatly appreciated.
It is not possible to do this with a single query.
Instead, you can use two queries. If you do not want to do that, then using reports (as suggested by Alex) or a BI-solution would be other possibilities.
Thanks to everyone here who spent time answering my question. The following describes the correct answer:
https://community.dynamics.com/crm/f/117/p/241352/666651#666651

In VSTS, how to query for PBI that has no uncompleted child tasks of a particular activity type?

We're using hosted Visual Studio Team Services to track our stories and tasks. We'd like our testers to be able to query for Product Backlog Items in the current iteration that have no uncompleted child tasks of the development activity type. I'm having trouble putting such a query together, any suggestions?
Use a "Work item an direct link" type query and set the Filter option to "Return items that do not match links" and the link type to "Child".
Filter the Child type further to include any combination of fields you don't want to have. You can use groups and and+or constructs to limit by multiple exclusive conditions.

TFS 2010 - Create a query that returns PBIs and Tasks associated to a user in a "collapsed" view

So I'm using TFS,
and I have a query that returns PBIs and Tasks in a collapsed view.
That's the Query:
Team Project = #Project
And Iteration Path Under SO Suite\9.0\SFDC\Sprint_2015_02\Sveta
And Assigned To = #Me
And Work Item Type In Product Backlog Item , Sprint Backlog Task
That's the result, in which you can spot, there are items which are assigned to multiple members:
Now, the PBI is assigned to me, so I guess that's why it include tasks from other members, but is there any way to filter such tasks out, and get the PBI with my Tasks only in the collapsed way?
any help would be appreciated.
When you use the Work Item and Direct Links or the Work Item Tree query types you get two queries. One for the top level and one for sub items.
In the UI when you edit the query you should see two queries. If you change the bottom one to show Assigned to = #me you can filter the sub items as well...
I'm guessing you used an OR clause for the two different work item types. If so you need to put parentheses around those two clauses in order to get the order of operations correct.
Alternatively, you can use one clause and do WorkItemType IN PBI, Task.
If this doesn't work, update your question with a screenshot of your query definition.

How to get all unique workitems of this week in TFS?

We are using TFS 2010.
Is there a way to find the unique work items types associated in all the check-ins for this week?
E.g. if there were 15 check-ins done this week, then some of them might have been associated to a "task" type of workitem, some to "bug" and some to "requirement". I need to get these workitem types used for check-ins.
Can i perhaps create a TFS query to get this data or by some other way?
This cannot be queried using a work item query, since the "Changeset" relation cannot be queried. It is possible to track the workitems which have changed between dates, but you cannot limit that to only triggering on added changeset relations.
You can of course query the history through the UI or the command line, but that doesn't provide you with an easily extractable list of work items.
It would be rather straightforward to use the TFS Client Object Models VersionControlServer class to query the history between 2 dates and then grab the list of associated work items from there. If such a solution would be something you'd consider.

Resources