DateTime of sprint backlog task status change to "Done" - tfs

Is there a field in TFS or any way to get the datetime value on which a sprint backlog task was changed to done?
I spotted an AuthorizedDate field but I'm not sure if it's out of the box or not.
Suggestions will be appreciated.

It is possible to get TFS to do this for you if your template isn't already set up to do so.
Start the TFS Process editor (Install TFS power tools if needed), connect to TFS and edit the WIT Task.
Create a new field called (For Example) CompletedDate with a suitable reference name (For example: StackOverFlow.Questions.TaskCompletedDate).
Set it to be of type DateTime.
Next go to the workflow tab and do the following for each of the transitions to the done state:
Right Click, select open details
Select the fields tab, click new.
Enter the reference name of the field you create above (StackOverFlow.Questions.TaskCompletedDate).
Select the Rules Tab and click new.
Select SERVERDEFAULT from the list of rules
On the dialog that appears, set the from field to clock.
Click OK, OK, OK to get back to the workflow.
Save the Work Item Definition.
See:
https://msdn.microsoft.com/en-us/library/ms194981.aspx

When your work item is set to done the closed date and closed by fields are set automatically.
These fields are part of all of the default templates.
Some of the older 2012 & 2013 templates did not include this for tasks and you would have to adds it', however you should use the out of the box provided fields and not create new ones. If you are reporting in this it's a nightmare if each work item type had its own way of doing things. Use the System.ClosedDate and System.ClosedBy field. You can copy the setup from the PBI or Bug work items..

Related

Can you add a drop-down box for BoardColumn in TFS?

In TFS, is it possible to add a drop-down box to the work item form that allows you to select/change the System.BoardColumn? Or is it only possible to change a board column via drag/drop on the board itself? This is in on premise TFS 2015
Use case: Sometimes we have an item open during a meeting to discuss it in depth. It would be easier to select a new column while the item is open for edit already than saving the item, then going back to the board to move it.
System.BoardColumn is a read-only field, you are not able to add a drop-down box for this field.
A workaround is mapping the State to the BoardColumn, and change the State field instead of BoardColumn field.

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.

"[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.

How can I add text to a work item

We have a few bugs and change requests which have a complicated iteration path. This results in people coming over the team to ask 'Where do we raise items' a lot.
As you can't set a default value for the iteration path in TFS 2010 we think the best solution would be to add a string of text under the field which we can manually update every 7 weeks with the correct area to raise items in.
However TFS doesn't seem to allow just a line of text on its work items as a control. Is there a way to add a line of display text i.e. Not a field you edit, but just to inform those writing the items?
Please note that it needs to be visible at all times, using the tooltip 'help text' field on a control is not enough in this case.
You can use the LabelControl for this purpose.
You can not have a default in the work item for the iteration path, but what you can do is making use or the template url in web access or the work item templates in the power tools to create a work item that is prepopulated with values.
What about a custom field with a display control in read-only? You can give a default value to the field and the "read-only" control prevent other to change it.

Rename work item type fails

In TFS2010/TFSPowerTools2010/Process Explorer I am creating a custom process template. I define a new work item type (WIT) called "Enhancement" copied from the CMMI "Change Request" WIT.
Then I want to rename the friendly field name of the work item type "System.Title" (called "Title") to "Summary".
When I upload my custom process template to the TFS server and create a team project, and then create a new Enhancement, the info in the required field text still shows :
"TF20012: Field "Title" cannot be empty.
Why ?
(I want to see "TF20012: Field "Summary" cannot be empty.)
What you can do is create a new field and make it required. Call it Summary, etc. Change the Title label and textbox from the stock values and point it to your new field. Do not remove the System.Title field from the field list.
In the work flow, use the Summary value to populate the System.Title field, which is not on the form. Then if they try to save without a Summary, they will get the correct error and System.Title will have a valid value for reporting.
Be sure you account for the System.Title field everywhere it is referenced in the work flow.
You aren't able to rename a system field like System.Title. It's used by other work item types across the team project collection and the server instance. It also has to be filled in by the default rules. You can rename the "label" that gets shown to the end user by going to the layout tab of the work item type editor (in the TFS Power Tools) and find the control and change it's label attribute but leave the field the same.
In Visual Studio I was looking at a WinForm and saving the form I got this error:
Microsoft Visual Studio Save failed.
TF20012: Field 'Title' cannot be empty.
OK
Since its a TF error I closed all the Work Items (even unsaved ones...) and then saving the Winform worked.
I am not sure how VS thought the Work Item was the active code window I saw looking at.

Resources