Alternatives to Computed Fields
Certain computations are resource-intensive and can affect the Codebeamer performance. PTC recommends considering the potential performance impact when implementing computation fields having the following:
• Dependencies to reference fields with suspected links propagation.
• An aggregation or a distribution rule.
• A downstreamReferences formula.
• A multi-level reference formula.
Alternatives to Computation
From the performance perspective, state transitions can represent a better alternative to computations in specific scenarios. The following sections list some detailed examples:
Change Handler with Boolean Fields
A formula like categories[0].id == 2 detects if the type of an item is changed to folder and returns a true or false boolean value. As a non-computation alternative, you can replace the preceding formula with a change handler that you can implement as follows:
1. In the tracker configuration, click the State Transitions tab.
2. Under the table of all the available transitions, click More list and select Change Handler option.
3. State: Select the state to which you want to apply the change handler.
4. Changes: To create a new change filter click Add hyperlink or to add an existing filter click Edit link.
5. Condition: Select Type in the list. In the next window, select the is option in the Type list and then type Folder in the text box next to the not check box.
6. Click OK.
7. In the Actions list, select Update item properties.
8. Select the recently created or edited change filter.
9. From the Fields to update menu, select the field you want the change handler to update based on the change handler conditions.
10. Click OK to close the window, and then OK and Save to submit your changes.
Change Handler with Text Fields and Integers
A formula like Integer((customField[16]+0.5)/customField[34]) calculates the integer value of a field. This formula can be used in the text area under the Result of option that appears when configuring the Update item properties. For the detailed steps, refer to the following example:
1. In the tracker configuration, select the State Transitions tab.
2. Under the list of all transitions, click More and select Change Handler in the list.
3. State: Select the state to which you want to apply the change handler.
4. Changes: To create a new change filter, click the Add link or to add an existing filter click the Edit link.
5. Condition: Set the fields on which the change handler filter depends. For example, select Planned Effort in the Condition list.
6. Click OK.
7. From the Actions menu, select Update item properties in the list.
8. Select the recently created or edited change filter.
9. From the Fields to update menu, select the field you want the change handler to update based on the change handler conditions.
10. Click OK to close the window, and then OK and Save to submit your changes.
Guard Condition
A guard condition allows the transition to proceed only if the tracker item meets specific criteria. This can replace resource-intensive formulas such as downstreamReferences in certain scenarios. For example, the following steps explain how to use a guard to prevent the closure of an item in the epics tracker if the item has user stories in open status:
1. In the tracker configuration of an epics tracker, select the State Transitions tab.
2. Click the transition name to which you want to add the guard. For example, Complete from In progress to Done status.
3. Next to Guard, click Add.
4. Next to Condition click the list and select User Stories for Epic under References section.
5. Configure all necessary conditions to prevent the transition. For example, select Has no option in the User Stories for Epics list and select the status Open in the With status list.
6. Click OK to close the window, and then OK and Save to submit your changes.