Seapine Labs
Personal tools

Trigger Using SOAP To Update Folders

From Seapine Labs

Jump to: navigation, search

Works with TestTrack 2008 and later

Contents

[edit] Overview

This article outlines how to create a trigger in TestTrack which calls a script that will add a defect to a folder in TestTrack.


You will need:

  • The TestTrack SOAP SDK installed.
  • The path to your TestTrack SDK installation. If you are familiar with how web servers work and your IT environment, you can probably guess this. Otherwise ask your TestTrack administrator or IT staff for help.
  • Permissions to create triggers in TestTrack.


You will get:

  • A trigger that will automatically add to a specified folder any defect that the trigger is run on.


What we will do:

  • Review the script that is going to interface with TestTrack.
  • Review how to write the enclosing batch file.
  • Create TestTrack trigger to call batch file.
  • Examples of trigger use.

[edit] Add To Folder Script

The script you will be using is written in C#. The benefits of using C# are that it is easy to understand and allows for some pretty sophisticated triggers. The code itself should be fairly self explanatory if you have some familiarity with C# or C++ and XML. The executable from the C# code must be run from a batch script with some additional parameters. This was done to make the script more versatile and to prevent you from having to recompile the executable every time you want to use a different folder, sever, user, password, etc.


Source For Script

Trigger Executable

Batch File Example


[edit] Batch File How-to:

In the batch script you will need to pass 5 input parameters when calling the exe:

  • url - Network path to your ttsoapcgi.exe.
  • folder - Path to folder you wish to add to.
  • user - TestTrack user you wish to login with.
  • password - TestTrack password for the user above.
  • log - Path to log file.


There is an example of a batch file above for reference. It is suggested that you use a dedicated user to run your SOAP scripts from as there will be an error if the user name you are using is currently logged in to the project and the actions of your scripts will be easier to track.

[edit] What the Script does when called:

  • Pulls in command line arguments.
  • Gets environment variables using:
    • sytem::EnvironmentGetEnvironmentVariable(Variable)
  • Login to project.
  • Adds defect the trigger is run on to the folder specified in the batch file.
  • Logout of project.


[edit] Create the Trigger

Log into Testtrack with a user that has permissions to create triggers. Go to Tools -> Administration -> Automation Rules. Then select the triggers tab and click the add button. Set all the settings you want and on the actions tab select the run executable option, enter the path of the batch file that you created earlier then save the trigger.

[edit] Use of the Trigger

An example of the use of this trigger would be to put every newly entered defect into a folder called "Review". The trigger would be set up like above and every new defect would be put into the "Review" folder as they are added. This would enable a project manager to quickly assign new defects to the appropriate developers. It could also be used with filters that target certain types of defects that a developer might be concerned with.

If when the script has run, nothing has been added to the folder that you specified, check the error log at the path that you entered in the batch file.

If you would like this script to work with Test Cases or Test Runs see the notes in the source code.

Note: Seapine does not provide support for sample triggers.














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