Skip to main content

Formula Definition

Configuration Location

Formulas are defined in two places within sheet configuration:

Function Signature

Every formula function follows this pattern:

Accessing Item Properties

Use bracket notation to access work item field values:
Enum Values Are IDsWhen accessing enum fields, info.item['fieldId'] returns the enum ID (e.g., "yes"), not the display name (e.g., "Y"). Always compare against enum IDs in formula logic.

Field Access Patterns

Return Values

Null-Safe CalculationsAlways guard against null or undefined values. When multiplying risk parameters, return null for empty inputs to avoid displaying NaN or 0:

Named vs. Inline Formulas

Named Formulas

Define reusable formulas in the top-level formulas object, then reference by name in column definitions:

Inline Formulas

Define the formula directly on the column:

Formula Execution Behavior

diagram
Displaying a Value and Storing It Are SeparateOpening a document recalculates every formula and shows current values, but does not rewrite stored data. Values reach Polarion when you save the document — for rows that were created or edited, or that Check stored formulas marked as drifted. Formulas and Column Visibility covers the full rule, including the behavior on versions earlier than v26.7.1.

Bridging Top Panel Functions

For complex calculations, define JavaScript functions in the risksheetTopPanel.vm file and call them from sheet configuration formulas:
Accessing Document Custom FieldsDocument-level custom fields can be accessed via $doc.getOldApi().getValue('customFieldID') in the risksheetTopPanel.vm script section, then referenced from sheet configuration formulas through top panel functions.

Check Stored Formulas

When formula columns have readOnly: false, or when items are imported without formula execution, use Menu > Rows > Check stored formulas (available since v24.5.1) to reconcile formula values between Polarion and Risksheet.

Complete Example