Change Request Configuration File

This topic describes the ChangeRequest.xml configuration file. Your server configuration repository contains a Notifications subfolder containing this and other configuration files.

ChangeRequest.xml

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<notification-config version="1.0">
  <rule-list>
    <rule project="*" event="new" template="cr-new-html"/>
    <rule project="*" event="modified" template="cr-modified-html"/>
  </rule-list>
  <template-list>
     <template id="cr-new-html">
       <subject>New Change Request #~~ChangeNumber~~</subject>
       <body content-type="text/html" template-file=".\cr-new.html" />
     </template>
     <template id="cr-modified-html">
       <subject>Modified Change Request #~~ChangeNumber~~</subject>
       <body content-type="text/html" template-file=".\cr-modified.html" />
     </template>
     <template id="cr-new-txt">
       <subject>New Change Request #~~ChangeNumber~~</subject>
       <body content-type="text/plain" template-file=".\cr-new.txt" />
     </template>
     <template id="cr-modified-txt">
       <subject>Modified Change Request #~~ChangeNumber~~</subject>
       <body content-type="text/plain" template-file=".\cr-modified.txt" />
     </template>
  </template-list>
</notification-config>
Note: template is a mandatory rule attribute. It specifies the message template that you wish to use for the notification and it must correspond to one of the template nodes, such as <template id=”cr-new-html”>. event and project are optional rule attributes. event specifies whether the item triggering the notification is being created (“new”) or edited (“modified”) or either of the two (“*”). If omitting the event attribute, the notification applies to any event. project allows the notification to be limited to a certain project or projects only. If omitted, the notification applies to all projects.
Note: You can give the template-file attribute an absolute file path or a path relative to the Notifications folder.

Examining the Configuration File

When you create or modify a change request, the server searches through the rules defined in the <rule-list> element for the first project attribute that matches the name of the current project that consists of more than the asterisk wildcard character. This allows you to use project=”*” for any projects where you have not created a more specific rule. For example, using the sample code shown above, a project names Project2 would use the text templates and a project named Whitestar would use the HTML templates.

Next, the server searches the matching rule to determine if it applies to the current “new” or “modified” change request. The event attribute of the rule determines this by the values “new” or “modified”. If this value is absent or set to “*”, all change requests use the rule. If the current change request is new, a rule with an event attribute of “new” or “*” must be found.

Once the server finds the correct rule, the template attribute indicates where to look in this .xml file for the subject line to use in the email, the type of template file, and the path to the template file. In the sample ChangeRequest.xml file, if the template attribute in the selected rule was “cr-new-txt” the server uses the following template section to obtain more information:

<template id=”cr-new-txt”>
<subject>New Change Request #~~ChangeNumber~~</subject>
<body content-type=”text/plain” template-file=”.\cr-new.txt” />
</template>

The subject line of the email reads New Change Request followed by the change request number. The template content type is “text/plain” and the template file is located at “.\cr-new.txt”. You can use the absolute path or a path relative to the Notifications folder for the location of the template file. This example uses a relative path to locate the template file within the Notifications folder.