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 perspective of performance, 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 list all transitions, click More and select Change Handler in the dropdown list.
3. State—Select the state to which you want to apply the change handler.
4. Changes—Create a new change filter by clicking the Add link or add an existing filter by clicking the Edit link.
5. Condition—Set the following options:
and Type is in "Folder"
Type changed
6. Click OK.
7. From the Actions menu, select Update item properties in the dropdown 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.
For example: Fields to update: <field to update>, Set to, Value, True.
10. Click OK to close the window, and then OK and Save.
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, click the State Transitions tab.
2. Under the list of all transitions, click More and select Change Handler in the dropdown list.
3. State—Select the state to which you want to apply the change handler.
4. Changes—Create a new change filter by clicking the Add link or add an existing filter by clicking the Edit link.
5. Condition—Set the fields on which the change handler filter depends, for example:
and Planned Effort changed
or <field name> changed
6. Click OK.
7. From the Actions menu, select Update item properties in the dropdown 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.
For example: Fields to update: <field to update>, Set to, Result of, Integer((customField[16]+0.5)/customField[34]).
10. Click OK to close the window, and then OK and Save.
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, click 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. Click the dropdown list next to Condition.
5. Select References > User Stories for Epic.
6. Configure all necessary conditions to prevent the transition, for example:
and Has no User Stories for Epic with status "Open"
and Has no User Stories for Epic with status "Pending"
and Has no User Stories for Epic with status "In progress"
and Has no User Stories for Epic with status "Unresolved"
and Has no User Stories for Epic
7. Click OK to close the window, and then OK and Save.
Was this helpful?