Seapine Labs

Using a Trigger to Change the State of a File in Surround SCM

From Seapine Labs

Jump to: navigation, search

Works with TestTrack 2008

Works with Surround SCM 2008

Contents

[edit] Introduction

In this example, a TestTrack trigger launches an executable that changes the state of the files in the source code tab of the defect in Surround SCM. It is designed to change the state of a file when a defect reaches a specific state.

This example shows how you can link the TestTrack Workflow with the Surround SCM workflow. It only works one way, from TestTrack to Surround SCM. A change in a file state in Surround SCM will not change the state of the defect that the file is attached to.

[edit] System Requirements

  • TestTrack Studio 2008
  • Surround SCM 2008

The application was written in C# using Visual Studio 2005.

[edit] Installing ChangeSSCMState

  • Download the trigger file.
  • Copy the ChangeSSCMState.exe and the runner.bat file found in the bin\debug\ directory to a server side location where it can be executed. Make sure it is on a local drive on the server.
  • The runner.bat file launches the ChangeSSCMState.exe file along with arguments needed to run the executable. Following are the arguments:
    • State ID: ID of the state in Surround SCM. To get the state ID, run the "sscm lsstate" command. Refer to the Surround SCM CLI Guide for further details.
    • Username: The Surround SCM username.
    • Password: The Surround SCM password.
    • Server: The Surround SCM Server address and port.
    • Comments: Comments for the set state event in Surround SCM.

The batch file includes the following example: ChangeSSCMState.exe "8" "Administrator" "" "127.0.0.1:4900" "Defect Verified"

[edit] Setting Up the Trigger in TestTrack

Refer to the TestTrack User Guide for detailed instructions on how to create a trigger.

A few pointers:

  • Use a filter to limit which defects will fire off the trigger.
  • Select which state change will fire off the trigger. The sample comments used in the runner.bat files are meant to be used with the verify event. In this scenario the 'Defect Enters Verified State' event is used.
  • In the Run executable option enter the full path to the runner.bat file.

The trigger runs through all files in the source code tab and sets their state. Note that this state change will be applied to the latest version and not the fixed revision.

[edit] Improvements/Enhancements

An improvement to the sample trigger could be to get the version of the source code file attached to the defect and then set the state of that specific version. Note that the state change may not be visible in the Surround SCM client because it displays the latest version of the file and the version attached to the defect may be a previous version.

Also, everything could be done by a batch file. I chose to use a C# application because that is what I am most familiar with.

[edit] Resources

Documentation that can help you improve or enhance this trigger.

  • TestTrack User Guide - Get help on how to setup triggers, and the environment variables. Use environment variables to get information from the defect that fires the trigger.



Note: Seapine does not provide support for sample triggers.














Issue Management Software | Source Code Control Software | Test Case Management | Requirements Management Software