User's Guide > About the User's Guide > Codebeamer: Common Concepts > Trackers > Hide If and Mandatory If Formulas
Hide If and Mandatory If Formulas
You can hide fields or make the fields mandatory for a tracker item by using a computed formula. You can use the same expression language used for computed field formulas.
Hide if formula
Go to the Fields tab on the Tracker Configuration page and select a field. Below the Computed as row you can see a Hide if row where you can type your own formula. That the Hide if formula is not available for Summary and Description fields.
In this example, the Requirement tracker of the Agile-Scrum Smart Template is used. We set the following Hide if formula for the Resolution field:
categories[0].name == 'Information'
This formula means that if the value of the Type choice field (which has the property name categories) is set to Information, the Resolution field and its value are immediately hidden.
Using the Same as Checkbox
Once you set at least one Hide if formula, you can use the same formula for other fields. Select a field where you want to copy the Hide if formula. Select the Same as check-box, and from the dropdown list select the field from which you want to use the same Mandatory if formula
In this example we use the same Hide if formula for the Complexity field as for Resolution field. The formula is copied to the text area in read-only mode.
Affected Pages
The following pages are affected by setting a Hide if formula:
The edit page fort a tracker item. While editing the field values, the Hide if formula is checked immediately. The formula decides whether the fields should be visible or not, and the affected fields are flashed with a yellow background.
Figure 34. Edit Tracker Item
Edit Tracker Item
The details page for a tracker item. After using inline edit, the affected fields are hidden or shown according to the Hide if formulas.
Document View / Planner right Issue properties section: After using inline edit, the affected fields are hidden or shown according to the Hide if formulas.
* 
Hide if formulas are not used on Table View or Report pages. You will see all the fields and their values on these pages, regardless of the Hide if formulas that are set.
* 
Hide if formulas are currently supported only for HEAD version of items.
Handling mandatory fields
You can use Hide if formulas and mandatory fields at the same time, but the behavior can vary if a field is hidden or shown because of the Hide if formulas that are set.
If a field is mandatory, but it is hidden because of a Hide if formula, the mandatory check is skipped. The mandatory field value can not be empty. Once the field is visible, the mandatory check applies.
Mandatory if formula
You can mark fields as mandatory for a tracker item by using a computed formula. You can use the same expression language used for computed field formulas.
Go to the Tracker Configuration page Fields tab and select a field. Below the Hide if row is a Mandatory if row where you can type your own formula. The Mandatory if formula is not available for Summary and Description fields.
In this example we use the Task tracker of the Agile-Scrum Smart Template. We set the following Mandatory if formula for the Assigned to field:
namedPriority.name == 'High' || namedPriority.name == 'Highest'
This formula means that if the value of the Priority choice field (which has the property name categories) set to High or Highest, the Assigned to field value is mandatory.
Mandatory If Formula for Assigned to Field
Mandatory If Formula Assigned to Field
Using the Same as Checkbox
Once you set at least one Mandatory if formula, you can use the same formula for other fields. Select a field where you want to copy the Mandatory if formula. Select the Same as check-box and from the dropdown list select the field from which you want to use the same Mandatory if formula.
In this example we use the same Mandatory if formula for the Release field as for the Assigned to field. The formula will be copied to the text area in read-only mode.
Mandatory If Formula for Release Field
Mandatory if Formula Release Field
In that case the Assigned to field and Release field will be mandatory if the value of the Priority field is High or Highest.
Affected pages
The following pages are affected by setting a Mandatory if formula:
Tracker Item Edit page: While editing the field values for a tracker item, the Mandatory if formula is checked immediately. If some fields became mandatory because of the formula, the affected fields are flashed with a yellow background and the red star is displayed next to the field label. Table columns are also affected.
In our example, the Priority field to Highest, so that the Release and the Assigned to fields become mandatory.
When saving the tracker item mandatory fields are checked and the user will get an error message if any mandatory fields have no value, where they are standard mandatory fields or fields that are mandatory because of a Mandatory if.
Tracker Item Details page / Inline edit: While performing an inline edit on the details page for a tracker item, if the user tries to save the item after modifying a field value that causes some other fields to become mandatory because of the Mandatory if formula, an Edit Mandatory Field window displays which showing the missing mandatory fields for the users to enter. This allows user to save the modifications in one step.
In our example, the Priority field is set to Highest on the Tracker Item Detail page. The Release and Assigned to fields do not have values. When trying to save the modified Priority value, a dialog appears with the missing Release and Assigned to fields, which became mandatory because of the Mandatory if formula.
The Save button works only when a user the missing mandatory field values entered.
Edit Mandatory Fields Window
The Edit Mandatory Field window displays for the following screen where inline edit is enabled:
Table View
Detailed Panel View right pane properties panel
Traceability Table View
Report
Planner
Document View right pane properties panel
Planner right pane properties panel
The Edit Mandatory Field window also displays for the Suspected merge diff overlay
Functionalities with a Mandatory if Check
The following functions check the Mandatory if formula when trying to save tracker items:
Document Edit View
Mass Edit
Test management functions (Test Runner, Test Case edit, and so on.)
Word / Excel import
Workflow transitions
Error messages appear if fields become mandatory because of the formula.
Disabled Functionalities
Doors and JIRA integration is not possible for trackers where there is at least one field with a Mandatory if formula. If a tracker is already synchronized with Doors and JIRA, the Mandatory if input is disabled for all fields.
Handling Mandatory if Formulas with Hide if Formulas
You can use Hide if formulas and Mandatory if formulas at the same time, but the behavior can vary if a field is hidden or shown because of the Hide if formulas.
If a field is mandatory because of the Mandatory if formula, but is hidden because of a Hide if formula, the mandatory check is skipped. This means that the mandatory field value could be empty. If the field is later shown, the mandatory check will apply.
Was this helpful?