TFS and MS Project : Adding Duration from MS Project into Task Work Item


 

I am going to step through an example of adding the “Duration” field from MS Project into an Agile Task Work Item.

First download a copy of the MS Project field mapping file from the Team Project.

image

Open a Visual Studio 2008 Command Prompt and execute the following command:

C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7>tfsfieldmapping download http://%5BtfsServer%5D:8080 [projectName] c:\tmp\projmap.xml

Open the Task Work Item from the Team Project using the TFS Power Tools in Visual Studio, click Tools | Process Editor | Work Item Types | Open WIT from Server

Select the Team Project and the Task Work Item Type

Add a new “Field” to the Work Item Type:

image

On the Layout Tab add the new control to hold the value from MS Project as shown below:

image

Save the change and it will immediately update the Task Work Item Type for that Team Project

Now open the MS Project mapping file in Visual Studio you downloaded in the first step and add the following line to define the mapping of the “Duration” value:

<Mapping WorkItemTrackingFieldReferenceName="Microsoft.VSTS.Scheduling.Duration" 
ProjectField="pjTaskDuration" PublishOnly="true" ProjectUnits="pjDay"/>

Save the mapping file and upload it back to the server:

image

Open a Visual Studio 2008 Command Prompt and execute the following command:

C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7>tfsfieldmapping upload http://%5BtfsServer%5D:8080 [projectName] c:\tmp\projmap.xml

Open MS Project and update the information for the Tasks like this:

image

Click the “Publish” button to push the changes back to TFS.

Now when you open a Task in Team Explorer it should display the information as shown below, this is Work Item ID #60 from above:

image

If you get stuck, feel free to leave a comment.

About wesmacdonald

Wes MacDonald is a Visual Studio ALM MVP, MCT, MCTS, MCITP (SharePoint 2010) and a Principal Consultant for LIKE 10 INC., a SharePoint Server and Team Foundation Server Consulting Firm providing premium support and guidance services.

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 1,034 other followers

%d bloggers like this: