Triggering on fixes

To configure Helix Server to run trigger scripts when users add or delete fixes from changelists, use fix triggers: these are triggers of type fix-add and fix-delete.

The special variable %jobs% is available for expansion with fix triggers; it expands to one argument for every job listed on the p4 fix command line (or in the Jobs: field of a p4 change or p4 submit form), and must therefore be the last argument supplied to the trigger script.

Note

Fix-add triggers might be also be run following the submission of a changelist if the job associated with the changelist exists both on the personal and the shared servers. For more information on push triggers, see Triggering on pushes and fetches.

The following table describes the fields used for a fix trigger definition.

Field Meaning

name

The name of the trigger.

type

  • fix-add: Execute fix trigger prior to adding a fix.
  • fix-delete: Execute fix trigger prior to deleting a fix.

path

Use fix as the path value.

command

The trigger for Helix Server to run when a user adds or deletes a fix. Specify the command in a way that allows Helix Server account to locate and run the command. The command (typically a call to a script) must be quoted, and can take as arguments any argument that your command is capable of parsing, including any applicable Helix Server trigger variables.

When your trigger script is stored in the depot, its path must be specified in depot syntax, delimited by percent characters. For example, if your script is stored in the depot as //depot/scripts/myScript.pl, the corresponding value for the command field might be "/usr/bin/perl %//depot/scripts/myScript.pl%". See Storing triggers in the depot for more information.

For fix-add and fix-delete triggers, fix addition or deletion continues whether the script succeeds or fails.