Wednesday, March 18, 2009

Problems in changing username for TFS services

I changed the username that's running all the TFS services on the TFS Application Tier machine. I noticed the next day that certain information such as users in the Assigned To dropdown, Areas, Iterations, etc. were not getting updated in a timely manner. What's going on? It turns out its in the Integration services. At is a discussion on this topic.

The following SQL on the TFS data tier will show whether or not the username on the TFS application tier has all 4 necessary subscriptions in place.

select s.address, i.domain, i.account_name from TfsIntegration..tbl_subscription s
left join TfsIntegration..tbl_security_identity_cache i on s.subscriber = i.sid
where delivery_type = 2

In my case the results didn't work so I had to login to the application tier server as the username running the TFS services and run the following 5 DOS commands in sequence substituting my server name for "".

cd C:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Tools

BisSubscribe.exe /eventType DataChangedEvent /deliverytype Soap /address http://:8080/VersionControl/v1.0/Integration.asmx /server http://:8080

BisSubscribe.exe /eventType DataChangedEvent /deliverytype Soap /address http://:8080/WorkItemTracking/v1.0/SyncEventsListener.asmx /server http://:8080

BisSubscribe.exe /eventType BuildCompletionEvent /deliverytype soap /address http://:8080/WorkItemTracking/v1.0/Integration.asmx /server http://:8080

BisSubscribe.exe /eventType ProjectCreatedEvent /deliverytype Soap /address http://:8080/Warehouse/v1.0/warehousecontroller.asmx /server http://:8080

On the 3rd one for a BuildCompletionEvent I got an error "requested value 'soap' was not found". When I dropped off the deliverytype parameter as follows it worked fine:
BisSubscribe.exe /eventType BuildCompletionEvent /address http://:8080/WorkItemTracking/v1.0/Integration.asmx /server http://:8080

So it appears to work properly now for the Assigned To dropdown. But the Areas dropdown is still not working properly. The Event viewer on the Application Tier server shows the TF51338 error. Solving this problem requires putting this username into the TFS Server's Service Accounts group. This can't be done in the TFS GUI like can be done for other server or team project groups in TFS. It requires the TFSSECURITY.exe command line utility. I went to a DOS window on the application tier server and typed in the following:

cd C:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Tools
tfssecurity.exe /server: /g+ "[Server]\Service Accounts" n:\tfsservices

Presto!! It worked :) My updates to Areas/Iterations get updated realtime into the Areas and Iterations tree views in the Work Item GUI of Visual Studio or TSWA. As soon as I click "refresh" on the Team Project my list of users in my "Assigned To" dropdown gets filled in.

Monday, March 16, 2009

Tasks "at the bottom" in MS Project

Microsoft Project is a great tool for creating task/schedule hierarchies for project tasks. It well-integrates with TFS. Whenever you run a query to import work items it'll automatically filter out duplicates from your WIQL results. It provides a grid of non-duplicate work items meeting the WIQL criteria with the first column of checkboxes pre-checked. This way you can further filter out work items to bring into your project plan document.

The problem is that all the new work items come in "at the bottom" of the MS Project plan. The solution can be found at under the heading "Moving tasks". Here are the steps to follow:

1. Remember to drag and drop, and do not cut and paste.
2. For the task you wish to move, select the entire task row by clicking the gray row heading, which includes the task number.
3. Point to the row heading until a four-headed arrow appears, and then drag the task to where you want it in the active view.
4. A gray line along the row border indicates where the task will be inserted when you release the mouse button.