This article explains how to create a Business Rule that sets or overrides field values when an item is added or updated. This can be used for example to set default values for fields without the user having to specify the values explicitly. Examples: To auto calculate the duration of a Task OR automatically set the Actual Progress on a task to 100% if an Actual End Date is specified. This can therefore be used to enforce business logic without using validation rules.
Adding a new business rule
Only the Support Desk can configure this type of business rule.
Under the Administration Menu, select Business Rules which will take you to the Business Rule List page, and then click on the Add Business Rule action button. On the form that is displayed, complete the information as described below:
Description: Provide an applicable description for the business rule e.g. "Task: Set Actual Progress to 100% on completion".
The entity this rule relates to: Here you select the entity that the rule relates to e.g. Task.
The events that should trigger the rule: The rule can be triggered when an item is added, updated or both or when an item is deleted.
Is the rule active?: The Active checkbox is by default selected when a new business rule is added.
Action: Select "Set Entity Fields". If you do not see this option in the list, make sure that you are cross-site authenticated on the instance.
Sort Order: Leave this as 1, unless the order in which business rules are evaluated is important.
XSL transformation of event XML: This is the XSL that is used to specify the field values. Data from the event including the old values (for updates), new values (add and update), the related project (if applicable) as well as the user updating the item are available.
Conditions and exceptions: In this section you can specify any conditions or exceptions for when the business rule should be triggered.
For more information on how to use Conditions and Exceptions, refer to this article.
Additional notes
Keep in mind that this type of business rule is executed before any other business rule, including validation rules and send e-mail rules.
It should also be noted that this rule does not create a separate history record as it forms part of the update done by the user.
Only fields for the entity that is being added or updated can be set. You can for example not set field values on the related project using this type of business rule. For that you should use a Call Web Service business rule.