Skip to main content

Overview

AspectDetail
Column typeAutomatically set to text when serverRender is defined
EditabilityAlways readOnly: true (set automatically)
Rendering engineApache Velocity on the Polarion server
Output formatHTML rendered in cell; plain text fallback for exports
BindingOptional; used as column id if id is not specified
PerformanceEvaluated per row on each grid load; complex scripts increase load time
diagram
When serverRender is set on a column definition, the configuration manager automatically forces the column type to text and sets readOnly to true. You do not need to specify these properties manually. This behavior is enforced server-side and cannot be overridden.

Column Definition Properties

PropertyTypeDefaultDescription
idstringAuto-generated from header or bindingUnique identifier for the column. Must be unique across all columns in the configuration.
headerstringNoneDisplay text shown in the column header.
serverRenderstringNoneVelocity template expression executed on the server to produce cell HTML content. When set, overrides normal data binding.
typestringtext (forced)Automatically set to text when serverRender is present. Cannot be changed.
readOnlybooleantrue (forced)Automatically set to true when serverRender is present. Cannot be changed.
levelnumber1Hierarchical level at which this column appears (1 = top level, 2 = second level, etc.). Not set for task-level columns.
widthnumberSee applicationColumn width in pixels.
minWidthnumberSee applicationMinimum width in pixels the column can be resized to.
headerGroupstringNoneName of the header group this column belongs to for multi-level column headers.
collapseTostringNoneColumn ID to collapse this column into when the header group is collapsed.
filterablebooleantrueControls whether users can filter the grid by values in this column.
multiLinebooleantrueEnables multi-line text display within cells.
wordWrapbooleantrueControls whether text wraps within cells.

Velocity Context Variables

The serverRender script has access to Polarion’s Velocity context. The most commonly used variables for server render columns are:
VariableTypeDescription
$itemWork ItemThe current Polarion work item object for the row being rendered. Provides access to fields, links, metadata, and project context.
$item.fields()Fields APIAccessor for work item field values, rendering, and metadata. Supports .get('fieldId') to access any field.
$item.fields().get('fieldId').render().htmlFor().forFrame()String (HTML)Renders a field’s value as HTML suitable for iframe/frame display, preserving rich text formatting and embedded images.
$item.getLinkedWorkItems()CollectionReturns all linked work items from the current item, each providing role and opposite-object accessors.
$item.getProjectId()StringReturns the Polarion project ID containing this work item.
$item.getId()StringReturns the work item ID.
$item.getTitle()StringReturns the work item title as plain text.
$item.getOutlineNumber()StringReturns the outline number within the parent LiveDoc document (e.g., 1.2.3).
$configConfigurationConfiguration properties defined at the document or project level. Accessed via $config.get('propertyKey').

Basic Configuration

A minimal server render column definition in risksheet.json:
{
  "columns": [
    {
      "id": "descriptionRendered",
      "header": "Description",
      "serverRender": "$item.fields().get('description').render().htmlFor().forFrame()"
    }
  ]
}
This column renders the description field as full HTML, preserving formatting, links, and embedded images. The column is automatically read-only.

Common Patterns

Rich text fields (description, custom HTML fields) display as plain text in standard columns. Use serverRender to render the full HTML including clickable hyperlinks, text formatting, and colors:
{
  "id": "descHtml",
  "header": "Description",
  "serverRender": "$item.fields().get('description').render().htmlFor().forFrame()"
}
The general pattern for any rich text field follows the same structure. Replace the field ID with your target field:
{
  "id": "notesRendered",
  "header": "Notes",
  "serverRender": "$item.fields().get('customFieldNotes').render().htmlFor().forFrame()"
}
Rich text fields that contain embedded images (such as symbol libraries, diagrams, or screenshots) render inline in the cell using this pattern. If images appear truncated, you can control the display size via CSS in the Top Panel template. When using images from rich text fields, ensure the column width is sufficient to display the image content legibly.
Construct clickable links that navigate to specific Polarion pages, external URLs, or other Risksheet documents:
{
  "id": "openItem",
  "header": "Open",
  "serverRender": "<a href='/polarion/#/project/$item.getProjectId()/workitem?id=$item.getId()' target='_blank'>$item.getId()</a>"
}
You can also construct redirect links to arbitrary paths:
{
  "id": "customLink",
  "header": "Link",
  "serverRender": "<a href='/polarion/redirect/project/$item.getProjectId()/wiki/Requirements/$item.getId()' target='_blank'>View Requirement</a>"
}

Displaying Indirectly Linked Work Items

For multi-level linked work items (Level 0 -> Level 1 -> Level 2), where you need to traverse intermediate links to display items that are not directly linked to the current row:
{
  "id": "indirectReqs",
  "header": "Linked Requirements",
  "serverRender": "#foreach($link in $item.getLinkedWorkItems())#if($link.getRole().getId() == 'relates_to')#set($linked = $link.getOppositeObject())$linked.getId(): $linked.getTitle()<br/>#end#end"
}
Server render columns displaying indirectly linked work items are always read-only. For editable multi-level linking, consider the upstreamChains configuration property (format: fromType-linkRole-toType), which automatically creates transitive link chains. Note that upstreamChains only creates links and never deletes them.

Horizontal Line Separators Between Items

When rendering multiple linked items in a single cell, use <hr/> tags to provide visual separation:
{
  "id": "linkedItems",
  "header": "Linked Items",
  "serverRender": "#foreach($link in $item.getLinkedWorkItems())#if($foreach.count > 1)<hr/>#end$link.getOppositeObject().getTitle()#end"
}

Outline Number Sorting

To sort Risksheet items by their LiveDoc outline number (so that 1.2.10 sorts after 1.2.2), create a server render column that zero-pads each segment of the outline number, then reference the column in the sortBy property:
{
  "columns": [
    {
      "id": "outlineSort",
      "header": "Outline #",
      "serverRender": "#set($on = $item.getOutlineNumber())#foreach($seg in $on.split('\\.'))#set($padded = \"000$seg\")$padded.substring($padded.length() - 4)#if($foreach.hasNext).#end#end"
    }
  ],
  "sortBy": ["outlineSort"]
}
Without zero-padding, string comparison sorts 1.10.1 before 1.2.2. With padding, 0001.0002.0002 correctly sorts before 0001.0010.0001.
Outline Number Zero-Padding
Input (raw) Velocity Output (padded) Sort Position
1.2.20001.0002.00021st
1.2.100001.0002.00102nd
1.10.10001.0010.00013rd
2.1.10002.0001.00014th

Multi-Project Configuration Properties

When defining server render columns that reference configuration properties across multiple projects, use $config Velocity variables in the typeProperties section. Space-separated project IDs can be referenced with separate $config lookups:
{
  "id": "crossProjectData",
  "header": "External Data",
  "serverRender": "$config.get('customPropertyKey')"
}
When using configuration properties to define multi-project upstream columns, empty property values after the = sign cause errors. The alternative project must use a direct project ID, not another configuration property variable. Always ensure configuration property values are non-empty.

Export Behavior

Server render columns produce HTML in the interactive grid. During exports, this HTML is converted to plain text:
Export TypeConversion LogicResult
ExcelHTML tags are stripped using text extraction. </li> tags are converted to newlines before stripping, preserving list structure.Plain text with line breaks for lists
PDFThe mainSheetCellFormatter strips HTML content to plain text. Server-rendered HTML is processed through the same formatter as other cell types.Plain text in PDF cells
The exact HTML-to-text conversion depends on the complexity of your Velocity output. Nested tables, complex CSS, or JavaScript in server render output may not convert cleanly to plain text exports. Test your specific scripts with both Excel and PDF exports.

PDF Export Considerations

When exporting to PDF via custom pdfscript.js, server render columns are handled by the renderDataCell function, which detects columns with serverRender defined and applies HTML-to-text stripping. The emptyPlaceholder property (configurable in custom export scripts) controls what text appears for null or empty server render output in the PDF.

Interaction with Other Column Properties

PropertyInteraction with serverRender
formulaMutually exclusive. Do not combine serverRender and formula on the same column. formula runs client-side JavaScript; serverRender runs server-side Velocity. If both are set, serverRender takes precedence (the column type is forced to text).
bindingOptional. When serverRender is set, the column does not bind to a data field for display. If binding is provided, it is used only as the default column id when id is not explicitly specified.
cellDecoratorsCompatible. Cell decorators can be applied to server render columns. The decorator function receives the rendered text value in info.value and the cell DOM element in info.cell.
sortByCompatible. Server render column IDs can be referenced in the global sortBy array for default sort ordering. Sorting uses the text output of the Velocity expression.
viewsCompatible. Server render columns participate in saved view column visibility toggling just like any other column type.
headerGroupCompatible. Server render columns can be grouped under header groups and support collapseTo behavior.

Complete Example

A full risksheet.json configuration demonstrating multiple server render column patterns in an automotive FMEA context:
{
  "columns": [
    {
      "id": "systemItemId",
      "header": "ID",
      "binding": "systemItemId",
      "level": 1,
      "width": 80
    },
    {
      "id": "title",
      "header": "Failure Mode",
      "binding": "title",
      "level": 1,
      "width": 200
    },
    {
      "id": "descRendered",
      "header": "Description (Rich Text)",
      "serverRender": "$item.fields().get('description').render().htmlFor().forFrame()",
      "level": 1,
      "width": 280,
      "headerGroup": "Failure Details"
    },
    {
      "id": "outlineSort",
      "header": "Outline #",
      "serverRender": "#set($on = $item.getOutlineNumber())#foreach($seg in $on.split('\\.'))#set($padded = \"000$seg\")$padded.substring($padded.length() - 4)#if($foreach.hasNext).#end#end",
      "level": 1,
      "width": 100
    },
    {
      "id": "linkedReqs",
      "header": "Requirements",
      "serverRender": "#foreach($link in $item.getLinkedWorkItems())#if($link.getRole().getId() == 'verifies')#set($req = $link.getOppositeObject())$req.getId()<br/>#end#end",
      "level": 1,
      "width": 150,
      "headerGroup": "Traceability"
    },
    {
      "id": "riskCategory",
      "header": "Risk Category",
      "serverRender": "$item.fields().get('riskCategory').render().htmlFor().forFrame()",
      "level": 1,
      "width": 130,
      "headerGroup": "Assessment"
    },
    {
      "id": "openInPolarion",
      "header": "Open",
      "serverRender": "<a href='/polarion/#/project/$item.getProjectId()/workitem?id=$item.getId()' target='_blank'>Open</a>",
      "level": 1,
      "width": 60
    }
  ],
  "sortBy": ["outlineSort"],
  "levels": [
    {
      "controlColumn": "systemItemId",
      "showInMenu": true
    }
  ],
  "dataTypes": {
    "risk": {
      "type": "fmea_risk",
      "role": "has_risk"
    },
    "task": {
      "type": "fmea_task",
      "role": "mitigates"
    }
  }
}

See Also

KB ArticlesSupport TicketsSource Code
  • PolarionAppConfigManager.java
  • ExportToPdf.ts
  • AppConfig.ts
  • risksheet.json
  • ExportToExcel.ts