September 26, 2013

Trigger and Email Notification Support for Surround SCM Code Reviews

Surround SCM
Version Control
Surround SCM 2013.2 introduces trigger support for code reviews and files in reviews. This enhancement allows you to edit email templates used in the default code review workflow, add new triggers to automate additional code review actions, and create email notifications to be automatically notified of changes to files in your code reviews as they move through the review process.

Editing email templates for the default code review workflow

The default code review workflow is controlled by 4 built-in triggers that email reviewers when reviews start or are overdue and email authors when reviews need attention or are approved. Users with permission to manage triggers can edit the email templates used with these triggers to specify the information included in the email sent to users. To view the default code review workflow triggers, choose Tools > Administration > Triggers. Select a trigger to review the full summary of the action it performs. TriggersDefaultCodeReviewWorkflow To edit the email template for a trigger, select the trigger and click Edit. On the Actions tab in the Edit Trigger dialog box, select the Sends email action, and click Edit. Click Edit Email Template in the Edit Trigger Action dialog box and then make any changes to the email template or code review file list. You can use text and field codes in the template to provide information specific to the event that triggered the email. CodeReviewEditEmailTemplate

Creating new triggers to automate additional code review actions

Users with permission to manage triggers can also add new triggers for other code review actions. For example, you may want to create a trigger to automatically email authors and reviewers if reviews are canceled or to change file workflow states based on the status of individual files in reviews. Triggers based on code reviews or files in reviews can send emails to notify users about changes, change custom field values, change workflow states on files, and run server-side executables. These triggers can run on every review or review file event, when a specific event is performed, or when reviews or review files change for any reason. To add a trigger, choose Tools > Administration > Triggers and click Add in Triggers dialog box. Select the event that causes the trigger to run, specify the criteria (preconditions) used to determine which reviews or review files the trigger applies to, and add the action to perform. AddTriggerCodeReviewCanceled

Adding email notifications to track code reviews

You can also set up your own email notifications to be automatically notified about specific code review and review file changes. For example, if you and another team member are both responsible for an upcoming feature, you may use one code review for the feature with you both listed as authors. You could set up an email notification to be notified if the other author starts the review or modifies its details. To add an email notification, choose Tools > My Email Notifications and click Add in the My Email Notifications dialog box. Select the event that sends the email notification and specify the criteria (preconditions) used to determine the reviews or review files the notification applies to. You can also click Edit Email Template to customize the template used for the notification to make sure the information you are most interested in is included in the email. AddMyEmailNotificationCodeReviewExample You can learn more about using triggers, setting up email notifications, and editing email templates in the Surround SCM help.