Automating actions with triggers
In-application programmable triggers allow you to extend Surround SCM’s functionality to better fit your company’s change management process. Triggers can be used to automate workflow state transitions, enforce workflow rules, send email notifications, run external applications, modify custom fields, perform data validation, log information, and more. For example, use triggers to automate manual source file management tasks, such as copying files to a web server when they reach a certain branch level.
When you create a trigger, you set the items the trigger applies to, the events that cause the trigger to run, and the actions to perform. Triggers can send emails, run executables, prevent users from performing events, add comments to events, change file workflow states, and change custom field values.
When triggers can run
The following events can cause triggers to run:
- File is created, enters a specific workflow state, version is updated, or changes for any reason
- Code review file changes for any reason
- Code review changes to a specific status, is awaiting review (runs nightly), or changes for any reason
- Event is performed on a file, code review, or code review file
- Changelist is committed
- Custom field value changes
Pre-event triggers perform an action when a client requests that an event be performed, but before the event is complete on the Surround SCM Server. Pre-event triggers can be used to perform the following actions:
- Run server-side executables (scripts and compiled programs)
- Prevent users from performing file events
- Add comments or append text to comments that users enter on file events
Post-event triggers perform an action after an event is successfully completed on the Surround SCM Server. Post-event triggers can be used to perform the following actions: