Query TFS based on value change of a field - tfs

There is any possibility in TFS UI to query based value changed of a field?
E.g.
Query all work items which have changed Automation status field to "Automated" in the past 2 days.

If the Automation status field reference the System.State (reference name), then you can try below query:
If the filed doesn't reference System.State, then we cannot achieve the requirement.
However you can custom a field and apply rules for the field to copy the value of State Change Date, something like this :
<FieldDefinition name="test" refname="test.date" type="DateTime">
<WHEN field="Automationstatus.xxx" value="Automated">
<COPY from="field" field="Microsoft.VSTS.Common.StateChangeDate" />
</WHEN>
<HELPTEXT>test</HELPTEXT>
</FieldDefinition>
Thus when you change Automation status to "Automated" for a work item, the changed date will be copied to the test filed. Then you can use the test field to filter the work items in future... but it's not available for current work items.

No there is no easy way to query on the change times of specific fields in the UI from the work item queries.
If your company has the Analytics Services turned on and available to users, then you could use Excel's Power Pivot tools to query the cube directly.
NOTE: The TFS Warehouse and Analytics Cube haven't seen major updates since their introduction in 2010 and are being replaced by the new OData based Analytics Service in Azure Devops.

I doubt there's a query parameter to satisfy your criteria entirely, but the closest I can come up with is this:

Related

TFS 2015: default value for old workitems

TFS 2015.2.1. I have a workitem with custum fields. I have seen that if I set a default value (a new rule for the template) this does not auto-populate pre-existing records.
While new records get the default value, the existing records remain with no value in the new field: if I open the workitem I can see the field
with the default value populated (also with old records) but this value is saved only when you save the workitem.
You can see this with a query: if you search workitems with "the default value" you will find only new workitems or old workitems re-opened and re-saved.
Is it possible to save a default value in old records?
I've tested in TFS 2015.3, when apply a default value with DEFAULT rule to a custom field like the example below, the pre-existing records also has this value:
<FieldDefinition name="version" refname="version.version" type="String">
<DEFAULT from="value" value="1.0" />
</FieldDefinition>
You may upgrade your TFS to TFS 2015.3, and set a similar rule as my example, your pre-existing records should have the default value too.
I've had this "issue" in the past, and your observations are right. Changing rules on a field in the work item template won't affect existing records until you open and save them. Therefore, you'll have to update existing records to populate your new fields with their respective default value.
You may use Excel to mass-edit the existing records and achieve your goal.
TL;DR; I have has this problem before and created a tool to bulk edit work items and fill out the values
1-1000 Work Items
Just use the Web Access bulk edit. Multi select in the web, right click, and select Edit.
1000-10,000 Work Items
Create a Query and then Open Excel and connect to TFS/VSTS and open the query. Bulk edit from here and publish.
10,000+ Work Items
Us the VSTS Sync Migration (https://marketplace.visualstudio.com/items?itemName=nkdagility.vsts-sync-migration) tools to bulk edit one or more fields in any number of work items. Use the "UpdateWorkItem" processor with as many "Field Mapps" to make the changes that you need.
Note: There are some inaccuracies in the documentation but if you install with Chocolatey you can use "vstssyncmigrator init" from anywhere.

How can I create a TFS rule on the AssignedTo field that displays a list of valid users and allows freetext entry?

What I am trying to do:
Set up a TFS work item to allow assigning tasks to people who don't have TFS accounts. Those users wouldn't access TFS. We just want to keep track of we assigned tasks to when those people are outside of our team.
What I have tried:
Basically I want to update the AssignedTo field on a task work item to allow entering values that aren't in the list, but still show a dropdown of valid AD users to pick from.
Replacing the ValidUsers rule with a SuggestedValues rule solves the problem of letting us add values that aren't in the list but we lose the dropdown of TFS users unless we manually type each person into a global list (which I'd prefer not to have to maintain).
Using both a ValidUsers rule and a SuggestedValues rule lets you use the dropdown AND type in a new value, but if the typed value isn't in the list it won't validate.
The Question
Is there a way to set up a SuggestedValues rule that pulls the suggested values from an AD or TFS group? Or perhaps there is another way of skinning this cat?
Yes, you can populate the SuggestedValues with a AD Security group or a TFS group with:
<ListRule expanditems="true">
<LISTITEM value="[Project]\Contributors" />
<LISTITEM value="[Project]\Project Administrators" />
<LISTITEM value="Domain\GroupName" />
</ListRule>

"[Me]" variable for custom field alerts in TFS 2013

I added a custom field (Test Prime) in TFS. Since I wanted a drop down of valid TFS users, I copied the setup of the Assigned To control (String, Dimension, ALLOWEXISTINGVALUE, VALIDUSER, and SYNCNAMECHANGES). I want to be able to set up an alert triggered when:
Test Prime Changes to [Me] or Test Prime Changes from [Me]
but "[Me]" or "#Me" does not seem to grab the current user. It's under the drop down menu of Assigned To so I don't see why I can't get access to this variable. Is it because this is for a non-core field and [Me] is only available for core fields? If yes, is there a workaround because I haven't been able to find any.
set the syncnamechanges="true" in the custom field definition. If the workitem template cannot be uploaded, use the witadmin tool to update the syncnamechanges attribute.
in the alert rule, use ##MyDisplayName## placeholder instead of [Me] or #Me.

Restrictive access to fields in workitem

I am working on customizing TFS workitem template for quite a while. But I am not able to find anyway in which you can restrict particular field in template - say "Priority" - depending on user. I mean I have TFS users A,B,C and D and I have requirement like - Priority field should be changeable only by A and B. I tried using VALIDUSER rule on Priority field but failed to succeed.
I think you want to use a READONLY field with a for \ notfor specified.
Example:
<READONLY for="DevelopmentUserGroup" notfor="AdminUserGroup" />

Sharepoint Make a custom list read only

I have created a custom list. I am using the same list in sharepoint designer through a page.
I a have a datetime field in the form. I want to make a default current date and time and let it make readonly.
How can I do the same.
thanks
As I understood you, you want to set custom permissions on a date field (column) in a custom list. Sharepoint 2007 does not allow column-level security via the UI as far as I know.
If you deployed the list definition via Feature you can set the site columns to be read-only by setting the field to read only via its column definitions like so:
Hidden="FALSE" ReadOnly="TRUE" Required="FALSE" PITarget="" PrimaryPITarget="" PIAttribute="" PrimaryPIAttribute="" Node=""
An easier solution is to use third party tools such as the Sharepoint Tool Basket. It has a feature called "List Manager" which allows you to set columns to read-only if it's not a system column - see the codeplex site for screenshots.
As for your datetime field having the date of Today, you can just create a new Site Column of type Date/Time and set its default value to be "Today".
So the easiest solution would be: Install the List Manager and activate the feature for your site. Create a new site column "Today" of type Date/Time with default value set to Today. Afterwards set the site column to read-only via the List Manager.

Resources