September 5, 2007

Synchronizing TestTrack and


Works with TestTrack 2008 and later

Will not work with TestTrack 7.6 and earlier

This sample uses a TestTrack trigger to synchronize defect changes with cases in

You'll need:

  • An existing account and the necessary permissions to create case custom fields and access the SDK.
  • Permissions within your TestTrack project to create executable triggers.

You'll get:

  • An automated TestTrack trigger that synchronizes defect changes with associated cases in


The download contains the source files and binaries needed to synchronize data between TestTrack and Download the SyncToSFDCCase zip file.

  • SyncToCase.exe - Executable built with C# .Net and Visual Studio 2005. This script handles synchronizing defect changes with associated cases in
  • SyncToCase.bat - Batch file that acts an intermediary between the TestTrack trigger and the SyncToCase.exe.
  • Source Code - Visual Studio 2005 solution and all required source code to build the SyncToCase.exe. You only need this if you want to make changes to the script. If you follow the steps in this article, the included .exe will work just fine.

Create TestTrack Trigger

You need to create a trigger in your TestTrack project to call the SyncToCase.bat you just downloaded.

  1. Login to your TestTrack project.
  2. Choose Tools > Administration > Automation Rules. Click the Triggers tab.
  3. Click Add to create a new trigger. Enter a trigger name, such as Sync.
  4. Click the Trigger When tab, select After Save then Defect is changed. This creates a trigger that executes after any defect changed is saved.
  5. Click the Actions tab, click Add and select Run executable from the list.
  6. Enter the path to the SyncToCase.bat you downloaded, being sure to wrap the path in quotes if it contains spaces.
You're all setup in TestTrack. Now you need to edit the SyncToCase.bat to call the SyncToCase.exe with the necessary parameters. When calling SyncToCase.exe, you need to pass your username and password in plain text. For example, C:SyncToCase.exe [email protected] mypassword


This step is optional. If you want to use the sample as it is then you'll need to create some custom fields in to store the TestTrack defect information. Alternatively, you can modify the code to do whatever you want, then rebuild the exe and go that route.

Creating custom fields

  1. To create custom fields in your account, choose Setup > App Setup > Customize > Cases > Fields.
  2. Create the following fields.
  • Defect Number - to store the TestTrack defect's number with the case in Create a field with Field Name TestTrack_Id, API Name TestTrack_Id (Salesforce adds the __c to the field name for custom fields you type, so the API name with which you refer to it will end in __c, and become TestTrack_Id__c.
  • Status - to store the TestTrack defect status with the case in Create a field with Field Name TestTrack_Status, API Name TestTrack_Status. Again, the API name is entered as the same in Salesforce, although the API will know it as TestTrack_Status__c.
  • Currently Assigned To - to store the TestTrack defect current assignments with the case in Create a field with Field Name TestTrack_Assigned, API Name TestTrack_Assigned.

Try It

The only thing left to do is to manually associate a defect in TestTrack with a case in Lookup a case number in your account, and enter that into the Reference field of a defect in your TestTrack project. Save the defect, and that should activate the trigger we created. Refresh your view, and you should see the three new custom fields populated with relevant data from the defect in TestTrack. To make this even better, hook up another example I wrote that lets you create defects in TestTrack from your account. Using both examples, you can have a fully automated way for your Support team to escalate cases to Development and be kept up-to-date on Development's progress without ever leaving their account.

Tech Details and Notes

This sample was written against the Partner WSDL, which is a more generic way to access their API. The great thing is it works against any account, so anyone can download this sample and use it as-is. If you're going to modify this for your own account, using the Enterprise WSDL would be easier since it creates all of the complex objects for you. The downside is that it's specific to your account so you have to regenerate the stubs anytime you add fields or objects to your account, and want access to those via the API. Probably easier than coding to a generic API, but just something to keep in mind. Note: Seapine does not provide support for sample triggers.