June 15, 2010

Bridging the Gap

Helix ALM
I was recently on-site with a customer. Aside from the usual tasks, like conducting training classes and configuring workflows, there was one interesting challenge. The customer wanted to integrate TestTrack RM and TestTrack TCM with ClearQuest. The customer did not want to use the ClearQuest API because they were using a very old version of ClearQuest and were planning on upgrading. The risk of changes in the API between the versions was high. The solution we came up with was to use the email functionality of TestTrack and ClearQuest as well as a custom application to implement a bridge between the applications. I wrote a C# application to retrieve emails and update TestTrack. It was important for the customer to have some visibility into the ClearQuest item from TestTrack.  The best way to do this was to create a defect in TestTrack that would be linked back to its source object (test case, test run, or requirement).  The defect essentially represented the item in ClearQuest. You can view the TestTrack Pro defect in the "Links" tab of an item. [caption id="attachment_4037" align="aligncenter" width="579" caption="Links Tab in TestTrack"]Links Tab in TestTrack[/caption]

The customer acquired a TestTrack Pro floating license in order for the bridge to create the defect in TestTrack Pro and update the status when it is updated in ClearQuest. The TestTrack Pro license is also needed to run traceability reports.

I created a workflow event to be available from a test case, test run, and requirement. The event is configured to not change state, and is available from most states. This allows the user to access a button or menu event to create a ClearQuest item.

I also set up a notification rule to send an email to ClearQuest when this event is performed. The email uses an email template configured to include all of the required fields. In each object, I created a custom field to store the link to the ClearQuest item. When ClearQuest creates a work item, an email is sent to a dedicated POP 3 account that the customer created for this purpose. An email is also sent if a user updates the state of a work item created by this mechanism. So the basic flow looks like this:
  • User performs event from a test run to create a ClearQuest work item.
  • An email is sent to ClearQuest.
  • ClearQuest creates the item and sends an email to the dedicated account.
  • At given intervals, the bridge application queries the email account.
  • For each email found, the bridge application updates the test case by adding the ClearQuest item included in the email.
  • It creates a defect. The ClearQuest ID is appended to the ClearQuest summary, and this becomes the Summary in TestTrack.  The ClearQuest URL is also mapped to the reference field.
  • The defect is linked to the test case.
A similar process takes place when the status is updated in ClearQuest.  An email is sent to the same account.  The application always checks the ClearQuest ID to see if it exists.  If it does exists, it updates the status. The beauty of this solution is it can be used with any other bug tracking tool, as long as the tool can import from email and send notifications to a specified account when the item is created and the status is updated.