Skip to main content

Overview

Polarion work items can contain rich text fields with HTML formatting, embedded images, and styled content. Risksheet supports displaying these fields read-only through server-side rendering with Velocity templates. Direct editing of rich text fields in the grid has limitations that require specific workarounds. diagram

Display a Rich Text Field

Add a column with the serverRender property using the Velocity expression that renders the field as HTML. Step 1. Open your risksheet.json configuration file. Step 2. Add a column with the serverRender property:
{
  "columns": [
    {
      "id": "description",
      "header": "Description",
      "binding": "description",
      "serverRender": "$item.fields().get('description').render().htmlFor().forFrame()",
      "width": 300
    }
  ]
}
The Velocity expression $item.fields().get('fieldID').render().htmlFor().forFrame() renders the full HTML content of the field, including images and formatting. Step 3. Replace 'description' with the actual field ID of your rich text custom field. For example, for a custom field named testRichTextFieldID:
{
  "serverRender": "$item.fields().get('testRichTextFieldID').render().htmlFor().forFrame()"
}
The field ID in the Velocity expression must match the Polarion field ID exactly. Check your project’s custom field configuration in Administration > Work Items > Custom Fields for the correct ID.
Columns with serverRender are automatically set to readOnly: true. You do not need to add this property separately.

Display Rich Text Fields with Images

Rich text fields that contain embedded images (such as symbol libraries or diagrams) require the same serverRender approach, but with a specific binding configuration. Step 1. Configure the column with serverRender as shown above. Step 2. Ensure the bindings reference task.$item rather than a specific field binding:
{
  "id": "symbols",
  "header": "Symbols",
  "binding": "task.$item",
  "serverRender": "$item.fields().get('symbols').render().htmlFor().forFrame()",
  "width": 250
}
When rendering rich text fields with images via serverRender, the bindings must be set to task.$item rather than the specific field binding. Using the wrong binding reference causes images to fail to render or display incorrectly.
Step 3. To control image sizing within the column, add CSS styles through a TopPanel template:
<style>
  .wj-cell img {
    max-width: 100%;
    max-height: 60px;
    object-fit: contain;
  }
</style>
CSS PropertyEffect
max-width: 100%Constrains image to column width
max-height: 60pxLimits vertical space per image
object-fit: containPreserves aspect ratio

Use Plain Text as an Alternative

When you need editable multi-line text rather than formatted rich text, configure the column as type: "text" instead:
{
  "columns": [
    {
      "id": "notes",
      "header": "Notes",
      "binding": "notes",
      "type": "text",
      "width": 250
    }
  ]
}
This stores content as plain multi-line text without HTML formatting, and the field remains fully editable in the grid.
Risksheet does not fully support editing rich text fields directly in the grid. Editing may strip line breaks and HTML formatting from the underlying work item XML, causing all text to collapse into a single line. Use type: "text" for fields that need to be editable.

Column Type Comparison

ApproachEditableFormattingImagesUse Case
serverRender❌ NoPreserved✅ YesDisplay formatted reports, diagrams
type: "text"✅ YesStripped❌ NoEditable multi-line notes
Default (string)✅ YesStripped❌ NoShort single-line text fields
For full property tables, Velocity snippets, export behavior, image sizing controls, and complete configuration examples, see the Rich Text Fields reference.

Verification

After saving your configuration changes, reload the Risksheet page. You should now see:
  • Rich text content displayed with full HTML formatting in the configured column
  • Images rendered inline if the field contains embedded images
  • The column is non-editable, indicated by the cursor not changing to an edit cursor on click
  • Formatting such as bold text, colored text, and lists preserved from the Polarion work item

See Also

KB ArticlesSupport TicketsSource Code
  • CellEditorFormatter.ts
  • GetSetUtil.java
  • risksheet.json
  • PolarionAppConfigManager.java
  • AppConfig.ts