Setting Project Priorities from TFS Priorities

Here is a handy macro that allows me to set the task priorities in Microsoft Project 2007 based on tasks that I have imported/synchronized to Visual Studio Team System. 

The reason I do this is because this allows me to have dependencies between TFS work items, determine which ones need to happen first, level my resources, and calculate completion dates for the work items.

 

Attribute VB_Name = "Module2"

Sub SetPriorityFromTFS()

Attribute SetPriorityFromTFS.VB_Description = ""

‘Description

    LevelingOptions Automatic:=False

    For Each T In ActiveProject.Tasks

        Select Case T.Text19

            Case 1

                T.Priority = "900"

            Case 2

                T.Priority = "700"

            Case 3

                T.Priority = "500"

            Case 4

                T.Priority = "300"

            Case 5

                T.Priority = "100"

        End Select

    Next T

    LevelingOptions Automatic:=True

    LevelNow

End Sub

No Comments