TFS 2012: Add the "effort" field to the "backlog" page - tfs

The default "Backlog" page on TFS 2012 looks like the screenshot below.
I'd like to add the "Effort" field to the "quick add" panel on the top (see arrow).
I know it involves changing xml templates, but I can't figure out the specifics.
How would I go about accomplishing that? :)

You need to change the AgileProcessConfig of the project:
Export the config file:
witadmin exportagileprocessconfig /collection:http://tfsserver:8080/tfs/DefaultCollection /p:ProjectName /f:d:\temp\test\agileprocessconfig.xml
Edit the agileprocessconfig.xml by adding the Effort field:
<ProductBacklog>
<AddPanel>
<Fields>
<Field refname="System.Title" />
<Field refname="Microsoft.VSTS.Scheduling.Effort" />
</Fields>
</AddPanel>
Import the file back to your project
witadmin importagileprocessconfig /collection:http://tfsserver:8080/tfs/DefaultCollection /p:ProjectName /f:d:\temp\test\agileprocessconfig.xml

Related

Can you add validation for swimlanes in TFS 2018?

I have a "Blocked" swimlane that I would like to add validation to. Specifically, I'd like to make a field required to be filled in when a backlog item is moved into this swimlane. Is this possible in TFS 2018? I've looked in the "TFS Process Template Editor" extension but I can't see how to do this. Thanks
Yes, it's possible, I prefer to do it with exportwitd and importwitd.
Export the work item XML with exportwitd.
Add a transition with your Blocked state and make a field required.
<TRANSITION from="In Progress" to="Blocked">
<REASONS>
<DEFAULTREASON value="Fixed"/>
</REASONS>
<FIELDS>
<FIELD refname="MyCorp.SomeField" >
<REQUIRED />
</FIELD>
</FIELDS>
</TRANSITION>`
Import the XML again to TFS with importwitd.
Now when a user moves the work item from "In Progress" to "Blocked" the field "MyCorp.SomeField" will be required.
You can find good documenation regarding above here, here and here.

Checkbox control in TFS witcommand

I have a custom TFS form. In this form i need to add a check box as
Select test:
Test1
Test2
Test3
Test1, Test2 and Test3 should be check box controls and the user can select any number of check boxes. How can I achieve this in TFS? I installed a code plex project http://witcustomcontrols.codeplex.com/
But there is no documentation on how I can use the controls or samples.
The download file from http://witcustomcontrols.codeplex.com/ contains an installer for the Windows controls and a .zip file for the Web Access controls.
To install windows control:
Simply run the msi setup and restart Visual Studio.
Fields associated with multivalue control should have list of suggested values and each value enclosed in square brackets. For example:
<FIELD name="Triage" refname="Microsoft.VSTS.Common.Triage" type="String" reportable="dimension">
<HELPTEXT>Status of triaging the bug</HELPTEXT>
<SUGGESTEDVALUES expanditems="false">
<LISTITEM value="[Approved]" />
<LISTITEM value="[Investigate]" />
<LISTITEM value="[Rejected]" />
<LISTITEM value="[Submit]" />
</SUGGESTEDVALUES>
</FIELD>
Then use MultiValueControl as controltype for that field in Form section, for example:
<Control Type="MultiValueControl" FieldName="Microsoft.VSTS.Common.Triage" Label="Triag&e:" LabelPosition="Left" />
Check: http://witcustomcontrols.codeplex.com/wikipage?title=MultiValue%20Control
To install web control:
Navigate in your browser to the configuration panel for the web
extension of TFS: http://servername:8080/tfs/_admin/_extensions
Click on the Install and upload the CodePlex.WitCustomControls.MultiValueControl.zip-file, make
sure to use the .zip file matching you TFS server version.
Enable the extension.
Check: http://witcustomcontrols.codeplex.com/releases/view/616048
As of the recent release of TFS 2015 Update 2, this can be done with the witd in on-prem TFS like this (example is from a Bug).
Definition:
<FIELD name="CustomerReported" refname="X.X.CustomerReported" type="Boolean" reportable="dimension">
<DEFAULT from="value" value="True" />
</FIELD>
Layout:
<Control FieldName="X.X.CustomerReported" Type="FieldControl" Label="Customer Reported" LabelPosition="Left" />

TFS 2013 auto assign to myself

My question is, if it is possible in the TFS 2013 Scrum process template, to make a work item (task) on the scrum board, automatically assign to myself when moving it from "to do" to "in progress"? Should it be possible to add this in the process template on TFS?
We are using an on premise TFS 2013 environment.
I thought I have seen the configuration somewhere but I can't find it on the internet (maybe I am using the wrong search keywords).
You will need to edit the process template for the Task Work Item Type Definition.
Use witadmin.exe exportwitd to download the Task definition
Find the Transition from "To Do" to "In Progress" and change it like so:
<TRANSITION from="To Do" to="In Progress">
<ACTIONS>
<ACTION value="Microsoft.VSTS.Actions.StartWork" />
</ACTIONS>
<FIELDS>
<FIELD refname="System.AssignedTo">
<COPY from="currentuser" />
</FIELD>
</FIELDS>
<REASONS>
<DEFAULTREASON value="Work started" />
</REASONS>
</TRANSITION>
Use witadmin.exe importwitd to re-import the Task definition.

TFS Workitems always leave 'Closed By' blank

We have a TFS workitem workflow where developers set workitems to be 'done'. It is largely our of the box with little custom configuration. This populates the 'Closed Date' but not 'Closed By'. The workflow continues as testers assign it to themselves and set the state to be 'Tested', but now I can no longer see on a report which developer closed the item.
How can I get a report of who did the work?
Given that you have a "Tested" state, it seems that the transitions have been customized. Ensure that all transitions to the "Closed" state have the correct rule on them to update the "Closed By" field. The Closed By definition on the transition should look something like this:
<STATE value="Closed">
<FIELDS>
....
<FIELD refname="Microsoft.VSTS.Common.ClosedBy">
<ALLOWEXISTINGVALUE />
<COPY from="currentuser" />
<VALIDUSER />
<REQUIRED />
</FIELD>
....
</FIELDS>
</STATE>
More information on customizing work item transitions can be found here and here.

TFS2012 Task work item definition - Update 'Remaining Work' with 'Original Estimate' whenever 'Remaining Work' is empty

On vs2013: tools > process editor > work item types > open WIT from server.
By editing the Task work item rules, I have come out with the following xml item definition:
<FieldDefinition name="Remaining Work" refname="Microsoft.VSTS.Scheduling.RemainingWork" type="Double" reportable="measure">
<WHENCHANGED field="Microsoft.VSTS.Scheduling.OriginalEstimate">
<COPY for="[global]\Project Collection Valid Users" from="field" field="Microsoft.VSTS.Scheduling.OriginalEstimate" />
</WHENCHANGED>
</FieldDefinition>
What I am trying to achieve is sth more like this:
<FieldDefinition name="Remaining Work" refname="Microsoft.VSTS.Scheduling.RemainingWork" type="Double" reportable="measure">
<WHENCHANGED field="Microsoft.VSTS.Scheduling.OriginalEstimate">
<WHEN field="Microsoft.VSTS.Scheduling.RemainingWork" value="">
<COPY for="[global]\Project Collection Valid Users" from="field" field="Microsoft.VSTS.Scheduling.OriginalEstimate" />
</WHEN>
</WHENCHANGED>
</FieldDefinition>
The problem is what I have now is not working for me (whenever I change Original Estimate, Remaining Work is not being updated), and I can't figure out how to stick in the WHEN clause.
I finally changed the Task tfs field definition for my project, via witadmin export/import:
On a Developer Command Prompt for VS2013
> witadmin exportwitd /collection:http://myTFSserver:8080/tfs/DefaultCollection /p:myTFSProject /n:Task /f:"c:\tfs\Task.xml"
replace the relevant section on Task.xml
<FIELD name="Remaining Work" refname="Microsoft.VSTS.Scheduling.RemainingWork" type="Double" reportable="measure" formula="sum">
<WHENCHANGED field="Microsoft.VSTS.Scheduling.OriginalEstimate">
<COPY for="[global]\Project Collection Valid Users" from="field" field="Microsoft.VSTS.Scheduling.OriginalEstimate" />
</WHEN>
</FIELD>
with
<FIELD name="Remaining Work" refname="Microsoft.VSTS.Scheduling.RemainingWork" type="Double" reportable="measure" formula="sum">
<WHEN field="Microsoft.VSTS.Scheduling.RemainingWork" value="">
<COPY from="field" field="Microsoft.VSTS.Scheduling.OriginalEstimate" />
</WHEN>
</FIELD>
then convey the change
> witadmin importwitd /collection:http://myTFSserver:8080/tfs/DefaultCollection /p:myTFSProject /f:"c:\tfs\Task.xml"
I can't think of a way to do what you want with just WITD.
Another (more complex) option is to create an ISubscriber plug-in that you deploy to your TFS. It can detect whenever your work items are changed and update fields appropriately using any logic you can write in C#.

Resources