Skip to main content

Symptoms

When editing rich text fields in Risksheet, you may notice one or more of these problems:
  • Line breaks disappear and all text runs together into a single block
  • HTML formatting (bold, italic, lists, headings) is stripped from the field content
  • The formatting loss persists in the underlying Polarion work item XML after saving
  • Saving the work item from Risksheet permanently removes the original rich text formatting
  • Content that appeared formatted in the Polarion work item editor looks like a single paragraph in the grid
diagram

Understanding the Root Cause

Risksheet does not fully support editing rich text fields. The grid cell editor treats all content as plain text, which means HTML tags and formatting markup are stripped when you edit and save the cell. Because the save operation writes the edited plain text back to the Polarion work item XML, the formatting loss is permanent — the original HTML is overwritten. This behavior affects any field that Polarion stores as rich text (Text type), including description, custom rich text fields, and any field where users have added HTML formatting through the Polarion work item editor.
Once you edit and save a rich text field through the Risksheet grid, the original HTML formatting cannot be recovered. The plain text value replaces the rich text content in the Polarion work item. Always use one of the workarounds below before allowing users to edit rich text fields in the grid.

Step 1: Switch to Multi-Line Text Type

The recommended workaround is to configure the column as type text (multi-line text) instead of relying on rich text editing. This preserves line breaks without attempting to parse or render HTML formatting:
{
  "columns": [
    {
      "id": "description",
      "header": "Description",
      "binding": "description",
      "type": "text",
      "multiLine": true,
      "wordWrap": true
    }
  ]
}
With type: "text", the field is treated as multi-line plain text. Line breaks entered in the cell editor are preserved on save, and the cell displays content with word wrapping enabled.
Setting the column type to "text" with multiLine: true and wordWrap: true is the recommended approach for description fields, notes, and any field where users need to enter paragraph-style content. This avoids the rich text stripping issue while still allowing structured multi-line input.
The following table compares the behavior of each configuration option:
ConfigurationEditableLine BreaksHTML FormattingUse Case
type: "text" + multiLine: trueYesPreservedNot renderedMulti-line descriptions, notes
isContentHtml: true + isReadOnly: trueNoPreservedRenderedDisplay-only formatted content
serverRenderNoPreservedFull HTML controlComplex rendering, clickable links
Default (no type override)YesLost on editStripped on editAvoid for rich text fields

Step 2: Configure Read-Only Rich Text Display

If you need to display rich text content with full formatting but do not need users to edit the field inline, set the column to read-only with HTML content rendering:
{
  "columns": [
    {
      "id": "description",
      "header": "Description",
      "binding": "description",
      "isReadOnly": true,
      "isContentHtml": true
    }
  ]
}
Setting isContentHtml: true renders the HTML content in the cell, preserving bold text, lists, links, and other HTML elements. Setting isReadOnly: true prevents users from editing the content through the grid, which protects the original formatting from being stripped. diagram Users who need to modify the field content can open the work item directly in the Polarion work item editor, where full rich text editing is available.

Step 3: Use Server-Rendered Columns for Complex Content

For fields that require complex HTML rendering with clickable links, images, or custom formatting logic, use server-rendered columns with Velocity templates:
{
  "columns": [
    {
      "id": "description",
      "header": "Description",
      "binding": "description",
      "serverRender": "$item.fields().description().render().htmlFor().forFrame()"
    }
  ]
}
For custom rich text fields, use the generic get() method with the field ID:
{
  "columns": [
    {
      "id": "riskNotes",
      "header": "Risk Notes",
      "binding": "riskNotes",
      "serverRender": "$item.fields().get('riskNotes').render().htmlFor().forFrame()"
    }
  ]
}
Columns with serverRender are automatically set to type: "text" and readOnly: true. This approach gives you full control over the display via Velocity templates while protecting the underlying rich text content from accidental modification.

Step 4: Verify Export Behavior

When exporting to Excel or PDF, rich text fields behave differently depending on column configuration. Ensure your chosen approach produces acceptable export output:
Column TypeExcel Export BehaviorPDF Export Behavior
type: "text"Plain text with line breaks preservedPlain text with line breaks
isContentHtml: trueHTML stripped, plain text extractedHTML stripped, plain text extracted
serverRenderServer-rendered HTML converted to plain text; <li> elements become newline-separated entriesHTML content converted to plain text
There is a known issue where PDF export may truncate text in cells due to a cell height calculation regression (tracked as NPT-1237). If you notice truncated text in PDF exports of rich text or multi-line columns, this is a known bug with a fix planned at highest priority. Multi-page risks may also exhibit unwanted text repetition in PDF output.

Decision Matrix: Choosing the Right Approach

Use this matrix to select the best configuration for your specific scenario: diagram

Verification

After applying your chosen configuration:
  1. Reload the Risksheet page to pick up the risksheet.json changes
  2. If you used type: "text" — edit a cell, add line breaks, save, and confirm the line breaks persist after page reload
  3. If you used isContentHtml: true — verify the cell displays formatted content (bold, lists) and that clicking the cell does not open an editor
  4. If you used serverRender — verify the cell renders the Velocity output and that links are clickable
You should now see multi-line text content displayed with line breaks preserved in the Risksheet grid, with no formatting loss on save.

See Also


Support TicketsSource Code
  • CellEditorFormatter.ts
  • ExportToExcel.ts
  • GetSetUtil.java
  • CommentBasedReview.java
  • MultiItemLinkEditor.ts