October 27, 2008

Duplicate SugarCRM Bugs to TestTrack Pro

Helix ALM

Works with TestTrack 2008

Works with SugarCRM 5.1

This article includes the steps to add a hook to your SugarCRM interface, which will automatically generate a defect in TestTrack every time a Bug is created in SugarCRM.

You'll need:
  • Your TestTrack Web server to be accessible from the SugarCRM deployment.
  • The path to your TestTrack Web server installation. If you're familiar with how web servers work and your IT environment, you can probably guess this. If not, ask the TestTrack administrator or IT staff for help.
  • A valid TestTrack projed id. This can be obtained from the TestTrack Admin Utility, or by contacting your TestTrack administrator.
  • Necessary permissions & knowledge to customize the back-end source code.
You'll get:
  • A back-end logic hook that duplicates a newly created SugarCRM Bug to TTP.


The download contains the source files needed for this sample integration. Download the Duplicate Bug Hook zip file.
  • logic_hooks.php - Logic hook that triggers the Bug deuplication.
  • CreateTTDefectFromBug.php - PHP script that does the Bug duplication.

Add the Code

The first (and only) order of business is to add the code to your SugarCRM installation. This is the dangerous part, where you copy the downloaded code into your SugarCRM installation.
  1. Browse to your SugarCRM installation directory.
  2. Copy logic_hooks.php into the ...custommodulesBugs directory (create if necessary).
  3. Copy CreateTTDefectFromBug.php into the ...custominclude directory (create if necessary).

Update CreateTTDefect

Next up, we need to make a couple minor changes to the defect creation script.
  1. Line 7 - Update yourserver with the location of your SugarCRM installation.
  2. Line 13/14 - Update the user/pwd to a SugarCRM account with permissions to login through Soap and pull Case data.
  3. Line 40 - Update yourserver/cgi-bin with the location of your TTP web installation.
  4. Line 40 - Update databaseid=??with the id of the TTP project you want to insert data to.
    • This project must have SoloSubmit access enabled.

Try it Out!

The only thing left to do is try it out.
  1. Log into your SugarCRM account.
  2. Open the Bugs module.
  3. Create a Bug, you should then see a new defect appear in TTP.


The Bug isn't duplicated into TTP

You have an issue with the CreateTTDefectFromBug.php. If it's a php issue, you'll typically get an error when you click it. If you don't get an error or a defect, then your problem is in connecting to TTP. To resolve, add a die(""); statement to the end of the file and start adding debug statements to see what's happening. With the die statement, the hook will terminate on every call, allowing you to look at the debug statements after creating a Bug. Also make sure your URL updates were made correctly, and everything is pointed where it should be.

How do I customize it further?

If you don't have the time or expertise to do it yourself, Seapine Services can assist with customizations. If you want to try it on your own, be sure to read up on the basics of SoloSubmit URLs along with details on finding the relevant field id's. Note: These instructions are provided as is; Seapine does not provide support for samples.