September 5, 2007

Accessing Field Data During Triggered Script Execution

Helix ALM
One of the most extensible features of the TestTrack triggers functionality is the ability to execute scripts when a trigger activates. From within the executing script, you can pull pretty much any piece of information from the object that triggered the script, via environment variables. Problem is, your defect object isn't the same as my defect object or another user's defect object. This makes it impossible for Seapine to provide a standard answer when you're wondering how to get the value of a custom field, specific event or some other field in the object. Some of the standard fields are covered in the next sections, or you can create a trigger in TestTrack to provide you with that information for your installation. [toc]

TestTrack Defect Fields

TestTrack Defect Environment Variables
VariableDefinition
DNUMDefect number
SUMMDefect summary
DFSADefect status attribute (Open/Closed)
STATDefect status
DISPDefect disposition field
PRODDefect product field
TYPEDefect type field
PRIODefect priority field
SEVRDefect severity field
NUMRDefect reported by count
FNDBxDefect reported by (where x is the reported by record)
FNDDxDefect date reported (where x is the reported by record)
DESCxDefect description (where x is the reported by record)
STEPxDefect steps to reproduce (where x is the reported by record)
FNDBx_ATT_CNTDefect reported by attachment count (where x is the reported by record)
FNDBx_ATTyDefect reported by attachment s(where x is the reported by record, y is the attachement number)
CREBDefect created by
CREBDefect created by
CREDDefect date created
MODBDefect last modified by
MODDDefect last modified date
ENTBDefect entered by
ENTDDefect date entered
FNDBDefect found by (see also FNDBx)
FNDDDefect date found (see also FNDDx)
EVT_CNTDefect event history count
EVTx_NAMEDefect historical event name, where x equals the ordering of the events (asc)
EVTx_Z_???Defect historical event field, where x equals the ordering of the events
SCC_CNTDefect source code attachment count
HEMLDefect has emails attached? (Yes/No)
PROJNAMETestTrack project name
TTSTUDIOURLTest Track Studio URL for defect

TestTrack Test Case Fields

TestTrack Test Case Environment Variables
VariableDefinition
TCNUMTest case #
TCSUMTest case summary
TCSTATest case status attribute (Open/Closed)
TCSTSTest case status
TCTYPTest Item Type
TCAUTAutomated Test? (Yes/No)
TCSTPTest case Steps tab
TCCBYTest case created by
TCDTCTest case date created
TCLSTTest case last modified by
TCDTMTest case last date modified
TCTTRTotal test runs generated from test case
TCPTRTotal test runs passed from those generated by test case
TCFTRTotal test runs failed from those generated by test case
TCOTRTotal test runs open from those generated by test case
TCCTRTotal test runs closed from those generated by test case
EVT_CNTTest case event history count
EVTx_NAMETest case historical event name, where x equals the ordering of the events (asc)
EVTx_Z_???Test case historical event field, where x equals the ordering of the events
TCSCRTest case has scripts attached? (Yes/No)
TCFILTest case has files attached? (Yes/No)
ATT_CNTTest case file attachment count
TCSCCTest case has source code attached? (Yes/No)
SCC_CNTTest case source code attachment count
HEMLTest case has emails attached? (Yes/No)
PROJNAMETestTrack project name
TTSTUDIOURLTest Track Studio URL for test case

TestTrack Test Run Fields

TestTrack Test Run Environment Variables
VariableDefinition
TRNUMTest run #
TRTCNTest case #, that generated the test run
TRSUMTest run summary
TRSTATest run status attribute (Open/Closed)
TRSTSTest run status
TRTYPTest Item Type
TRSETTest Run Set
TRAUTAutomated Test? (Yes/No)
TRSTPTest run Steps tab
TRCOVTest run test variant selection
TRESTTest run estimated time
Z_???Test run custom field (???? = fieldcode)
TRCBYTest run created by
TRDTCTest run date created
TRLSTTest run last modified by
TRDTMTest run last date modified
EVT_CNTTest run event history count
EVTx_NAMETest run historical event name, where x equals the ordering of the events (asc)
EVTx_Z_???Test run historical event field, where x equals the ordering of the events
TRSCRTest run has scripts attached? (Yes/No)
TRFILTest run has files attached? (Yes/No)
ATT_CNTTest run file attachment count
TRSCCTest run has source code attached? (Yes/No)
SCC_CNTTest run source code attachment count
TRRESTest run has run results? (Yes/No)
HEMLTest run has emails attached? (Yes/No)
PROJNAMETestTrack project name
TTSTUDIOURLTest Track Studio URL for test run

Download

Download the Trigger Script for Windows zip file.

Using the Script

  1. After you download the zip file, extract the batch.
  2. Create the trigger you want to use with TestTrack. Instead of pointing it to your actual script, point it to the batch file you downloaded.
  3. Now do whatever it is that activates the trigger in TestTrack. That could be editing a defect, creating a defect, or moving a defect into a specific state.
  4. Finally, assuming all went well with the trigger activation you should have a file named C:saveenv.txt. This file contains output of all of the environment variables accessible during the triggered script execution.
  5. Save the C:saveenv.txt file.
    • You can then review it when you're not sure how to access a certain piece of data.
    • You can also inactivate the trigger, leaving it available in case you add or change fields and need to generate a new list of environment variables.
Note: Seapine does not provide support for sample triggers.