About triggers

Surround SCM includes pre- and post-event triggers that are stored on the Surround SCM server. Triggers can only be fired from events on files. Each trigger is run once per file that it is associated with. Pre-event triggers run after a client requests that a command be performed, but before the event is complete. These trigger types let a server script perform additional checks on a file before the event completes. Pre-event triggers are for validation and custom text entry, such as keyword expansion. For example, you can create scripts for custom keyword expansion or to verify that text, such as a copyright notice, is included in certain files before check in.

Post-event triggers run after a command is successfully completed on the server. These triggers can either run a script or send email. Post-event triggers are for logging and synchronization. For example you can create scripts for custom logging of SCM file activity or to synchronize two separate Surround SCM servers.

Email triggers use a standard email template, which can be customized, to inform selected users when an event occurs to a file or a set of files. Each email template is stored with the trigger on the server.

Triggers can attach to the following file events: (all), (file version updated), (new file), Add, Add from branch, Attach to defect, Check in, Promote from, Rebase, Remove, Rename file, Restore, Share broken, Share created.

Did you know? Post-event triggers should always be used unless the trigger is used for validation purposes. Pre-event triggers, which are run once per file, can adversely affect performance because the Surround SCM server waits for the script to complete before moving to the next file. Even a one second pre-event script will significantly slow down the server because it will take one additional second per file that the trigger fires on. Post-event triggers may impact performance because each file affected by the action must be checked for existing triggers.