Team Foundation Server -> Microsoft Project integration - tfs

I am hoping someone here can shed light on my problem. I am trying to integrate TFS work items and MS Project. What field is mapped from the work item into the duration column of Project? I can change the way I am doing this, but, I had created a custom field Work Item field in TFS. I have the mapping file that TFS uses to map to Project. Here is my Work Item definition:
<FIELD name="EstCodingHours" refname="CustomFields.EstCodingHours" type="Double"
reportable="detail">
<HELPTEXT>Enter estimated number of hours to fix bug</HELPTEXT>
</FIELD>
Here is my mapping definition:
<Mapping WorkItemTrackingFieldReferenceName="CustomFields.EstCodingHours"
ProjectField="pjTaskDuration" ProjectUnits="pjHour" />
I can map to other fields such as pjTaskDuration1. Is pjTaskDuration read only perhaps? If I can figure out what maps into pjTaskDuration, I can use it instead of my new field EstCodingHours.
Thanks,
Scott

The TFS out-of-the-box templates don't map the duration field by default.
Wes Macdonald steps through the process of doing such a mapping in a blog post.

Related

Adding new "tab" to a bug work item in TFS 2017

I am trying to add a new "tab" to bug item in TFS 2017. Looking at the "tabs" you see things like "Steps to Reproduce", System, etc.
I have found information on changing work item types but nothing about adding a new "tab" across the top where you see Steps to Repro, System, Test Cases, Tasks. The change I want to make may not be possible? Or it is possible I don't know the correct verbiage to use when asking google. The think I want to change may not be a tab control at all it maybe something else different.
Thanks
***************** Updated questions after posting *****************************
After playing around with Process Editor -> WIT -> Open WIT from server -> Bug
as suggested by Andy Li-MSFT I don't see a lot of control on the formatting on the tab. I was planning to add fields in a grid like pattern like a table as shown below. I am able to get the values in the drop down list for field1 and add the fields. However I have a couple follow up questions if you have time.
Setting either the control or column for the control to read-only the column will not render when adding a new bug. I have a little more control if I set AllowedValues and Frozen for the column however the value can still be changed. Is there a better way to set read-only?
There is not much control on the layout. I am OK adding a lot of fields but would like them to be displayed in a table like structure. Is there a way to control the look of the fields on the form?
Is there a way to add the fields in a grid? This would be ideal so I only have one header for each column.
The last-updated-by and last-updated-date. Is it possible to track on a row level who made a change? If not I would be OK just adding a last updated by and last updated date to the new tab. Row level updates would be nice.
<pre>
Field 1 Field 2 (Read-only) Field 3 Last Updated By Last updated Date
Status (completed, empty, N/A) "Some text here which describes something to do" "Optional comments" tfs user name date/time
Status (completed, empty, N/A) "Some text here which describes something to do" "Optional comments" tfs user name date/time
</pre>
You need to modify the WIT definition file (Bug work item type in your scenario).
You can try below ways to do that:
Export the WIT definition file with witadmin commands, add a new tab under <TabGroup> and add a new control for it, then save and import the file. See Import, export, and manage work item types for details.
e.g:
<Tab Label="Tab0501">
<Control FieldName="System.ChangedDate" Type="DateTimeControl" Label="Test0501:" LabelPosition="Left" />
</Tab>
You can also use the TFS Power Tools to export/import WIT definition files or directly modify the files from server:
Visual Studio 2015 : Microsoft Visual Studio Team Foundation Server
2015 Power Tools
Visual Studio 2017 : TFS Process Template Editor
Reference below screenshot to do that.
Another way is writing an extension to Extend the work item form, you can reference my answer in another thread to do that.

Original Estimates in TFS Scrum projects (TFS 2017)

When creating a task in a TFS project that was created using the Agile template there is an option to enter an original estimate (See image a).
When creating a task in a project that was created using the Scrum template there is not option to enter original estimate at the task level.
Is there a way to add or turn on this feature. We use the Fibonacci effort sequence at the PBI/User Story level and make use of velocity, but we need to use original estimates at the task level for accounting purposes.
Reference img a:
Original Estimate (Microsoft.VSTS.Scheduling.OriginalEstimate) field exists in Agile and CMMI process template by default. You need to update the Task work item type definition in Scrum process template and add that custom field yourself:
Use witadmin tool to export the Task work item from the team project you want to customize:
witadmin exportwitd /collection:http://TFS2017:8080/tfs/DefaultCollection /p:ScrumProject /n:task /f:task.xml
Add the custom field between <FIELDS> </FIELDS>:
<FIELD name="Original Estimate" refname="Microsoft.VSTS.Scheduling.OriginalEstimate" type="Double" reportable="measure" formula="sum" />
Add a section between <Page Label="Details" LayoutMode="FirstColumnWide"> </Page>:
<Section>
<Group Label="Effort">
<Control Label="Original Estimate" Type="FieldControl" FieldName="Microsoft.VSTS.Scheduling.OriginalEstimate" />
</Group>
</Section>
Import the work item type:
witadmin importwitd /collection:http://TFS2017:8080/tfs/DefaultCollection /p:ScrumProject /f:task.xml
Then you'll see Original Estimate field:
You may download TFS Process Template Editor and edit work item type definition:
Open on VS 2017 Process Editor->Work Item Types->Open WIT from server.
Find your scrum project and work item type Task.
Add Original Estimate field to fields section:
Name=Original Estimate
Reference name=Microsoft.VSTS.Scheduling.OriginalEstimate
Data type=Double
Add new field to layout section.
You may find a sample in agile or cmmi project.

Translate TFS work item types to another language

Is it possible to translate work items to another language? for example change the field "Area Path" in a PBI to our language (Hebrew) "אזור", so the resulting xml would look something like this:
<FIELD name="אזור" refname="System.AreaPath" type="TreePath" reportable="dimension" />
The problem is that whenever I try to import my changes into tfs (via witadmin) I get the following error:
"TF26177: The field System.AreaPath cannot be renamed from 'Area Path' to 'אזור'."
Can I get help please?
https://msdn.microsoft.com/en-us/library/ms194968.aspx covers the parts that can be localized. I believe there are also language packs that might do some of this for you.
OK, i think i have found the way to do it. I was trying to rename the field via the command "witadmin renamewitd...", but it should be used with the command "witadmin changefield..." instead. Well, at lease I hope i'm right on this one :)
Update: nschonni posted a useful link for more info.

After upgrading to TFS2013 RTM, the search from the web interface returns "TF51535: Missing or unsupported field name."

After upgrading to TFS2013 RTM, the search from the web interface returns "TF51535: Missing or unsupported field name." It looks like the default fields to search changed.
How do you change the work item fields that are searched on by default in TFS2013?
What I have found so far:
It is searching on Title, Description, Repro Steps\
In TFS2010 you could follow the steps listed here to change the default (at least I assume... I didn't actually use that version)
This is likely to happen for anyone that started using bugs in an older process template and has continued to use and upgrade the template to work with the newer versions.
Microsoft is now searching on Description, Title, and "Repro Steps" by default. The error happens because "Repro Steps" is not in any of the work item types. This field maps to Microsoft.VSTS.TCM.ReproSteps the old similar field was Microsoft.VSTS.CMMI.StepsToReproduce
One way to fix the problem:
export the bug work item type
witadmin exportwitd /collection:CollectionName /p:projectName /n:Bug /f:"Bug.xml"
add the new field
FIELD name="Repro Steps" refname="Microsoft.VSTS.TCM.ReproSteps" type="HTML"
import the bug work item type
witadmin importwitd /collection:CollectionName /p:projectName /n:Bug /f:"Bug.xml"
This allows the search to find the field but with these minimum steps that field won't have anything in it. The search will effectively be on title and description only.
There are two other solutions:
- Change what fields are being searched on to not include reprosteps (I haven't figured out how to do this yet)
- Do the above, copy all the old data into the new field, show the new field on the WI. This would allow the search of the field as intended.

TFS "Assign To" is showing too many users

I am connected to a TFS server, and when I create a work item (Bug, Task, etc.), the "Assign To" shows WAY too many users. I cannot find a way to limit the users shown that will affect anyone else who connects to the server.
For example, I have under the "Assign To" dropdown:
Administrator
LOCALE SERVICE
User 1
User 2
User 3
User 4
User 5
I want the "Assign To" dropdown to only show:
User 1
User 3
User 5
How would I do this, so that it changes on the server, and if anyone new connects to the server, they can only see the three users on the "Assign To" dropdown?
Here's what you should do:
Open the Visual Studio Command Prompt. This will give you a command line window with the PATH set to run VS / TFS tools
Download the Work Item Type definition that you want to modify (e.g. Bug, Task):
witadmin exportwitd /collection:collectionurl /p:project /n:typename [/f:filename]
This will give you the WIT's definition, in XML format.
Open the XML file. You will edit the rules for the Assigned To field. Find the term "System.AssignedTo"
In the Allowed Values rule element, modify (or add if none exists) your List Item element to limit the values to members of one (or more) TFS / Active Directory group(s).
Your field definition should look like this:
<FIELD name="Assigned To" refname="System.AssignedTo" type="String" syncnamechanges="true" reportable="dimension">
<HELPTEXT>The person currently working on this bug</HELPTEXT>
<ALLOWEXISTINGVALUE />
<ALLOWEDVALUES expanditems="true" filteritems="excludegroups">
<!-- Below is a TFS group. Note you actually type "[project]" verbatim -->
<LISTITEM value="[project]\Contributors" />
<!-- Below is an AD group. The name and group are examples only -->
<LISTITEM value="MYDOMAIN\Developers" />
</ALLOWEDVALUES>
</FIELD>
Importing your changes:
Save your file.
In the command line window type the following:
witadmin importwitd /collection:collectionurl /p:project /f:filename
That's it. Your work item type is now limited to the people you want.
See my answer here for 2012, it may be similar: Visual Studio - Don't display all domain users in "Assign To" field
The problem was that [TEAM FOUNDATION]\Valid Users included
[TEAM FOUNDATION]\Team Foundation Administrators which included [BUILT IN]\Administrators
In the TFS Server Administration Console I selected Application
Tier and clicked Group Membership. I then double-clicked on
[TEAM FOUNDATION]\Team Foundation Administrators and removed [BUILT IN]\Administrators.
Now I only see my team and not all the SQL admins and engineers that
were local admins on the server. All without any command line or
addons.
You can:
1) go here https://teamprojectmanager.codeplex.com/releases and download the latest Team Project Manager;
2) launch it (an *.exe file in the archive);
3) connect it to your project;
4) go to "work item configuration" on the right;
5) then to "work item types";
6) select your item type (Product Backlog Item for instance), click "edit";
7) do what Assaf Stone suggested above, in my case it was just replacing
<VALIDUSER />
with
<ALLOWEDVALUES expanditems="true" filteritems="excludegroups">
<LISTITEM value="[project]\Contributors" />
</ALLOWEDVALUES>
8) save your changes;
That's it! BTW, the tool can come in handy for some other customizations as well.
After installing TFS power tools for Visual Studio.
From the menu open Tools --> Process Editor --> Work Item Types --> Open WIT (WorkItem) Type from Server.
Select the Collection and the Project and The Work Item that you need to make changes to.
Open the Assigned To field and Click on Rules Tab
Edit the Valid user an add the "group name" which you wanted to display.
Then save the Workitem by selection save in Visual Studio.
Hope this works.
Create a seperate group under the collection and add the users.
Open the Process template Add a rule to assigned to field Assigned to "Valid User" and select the Group which you created.
So after looking at a few keywords from hems I got some good google results.
The first thing you need to do is go into visual studio, and select team menu and from there go to collection settings. You will see process template and from there you can download one you have.
After you download it you can then modify any settings you want. When you are done, go to the same menu and this time click upload.
That is all it takes, but note you can only select this new one on project creation.

Resources