Software Expressions

.Net / Software / Visual Studio / TFS / other ramblings
 

Goto

Categories

 

Archive for the 'TFS' Category

01 5th, 2007

At first it seems it should be easy, but it takes a little bit to figure this out. Basically I wanted to know who changed what for the life of a project and all the files in the project.
- Right Click on the Project
- Get Specific Version
- Select ChangeSet (instead of Latest)
- Use the Ellipses to pick a ChangeSet
- In this dialog, change the filename to the folder in which you want to check for changes. It seems to default to a specific file and the changesets are then only for that file.
- The rest should be intuitive

What I’ve found seems to work, is creating the tasks offline, but don’t specify the Work Item Type, leave this until you’re online. It looks like there is some initialization that occurs in a TFS call which is ommitted when you specify the Work Item Type offline. If you do specify the Work Item Type offline, I don’t know that it’s even possible to get that task into TFS (at least in my limited experience).

There are several tricks that you need to know in order to generate the necessary synergy between Microsoft Project and Team Foundation Servers work items. One of those being, how do you update “PercentComplete” in Microsoft Project when the Developers only update CompletedWork and RemainingWork (and TFS does not allow complex mappings which could translate these into percent complete). One option is to generate a macro in MS Project that performs the necessary calculations. The other option would be to create a web service and register this service with TFS when any work item is updated. The web service would then query the work item, calculate and update the percentage. This also requires adding an additional “PercentComplete” field in the work item. I’d like to take this approach in the long term, but short-term, the following MS Project macro does the trick.

Sub CalcPercentComplete()
    Dim task As task
    Dim taskComplete As Long
    For Each task In ActiveProject.tasks
        If (Not task.Rollup) Then
            taskComplete = task.PercentComplete
            If (task.ActualWork = 0) Then
                taskComplete = 0
            ElseIf (task.RemainingWork = 0) Then
                taskComplete = 100
            Else
                taskComplete = Round(task.ActualWork * 100 / (task.ActualWork + task.RemainingWork))
            End If
            task.PercentComplete = taskComplete
        End If
    Next task
End Sub

This article on devx.com does an excellent job of describing the symbiosis of MS Project and VSTS.