Skip to main content

When to Use Custom Data Rendering

Use custom data rendering when you need to:
  • Show work items linked to your linked items (multi-level relationships)
  • Display filtered lists of related work items
  • Format output as HTML lists or custom layouts
  • Pull data that requires server-side queries or processing

Configure a Custom Data Column

Add a column with a serverRender property containing a Velocity script:
{
  "headerGroup": "Mitigations",
  "header": "Requirements",
  "bindings": "task.$item",
  "width": 170,
  "serverRender": "<ul style='margin-block-start: -16px;margin-block-end: -16px;padding-inline-start: 16px;'>#foreach($l in $item.fields().linkedWorkItems().back()) #set($r = $l.fields().workItem().get()) #set($t = $r.fields().type().get().id()) #if($t.equals(\"requirement\")) <li> $r.render().withTitle().withIcon(false).withLinks().htmlFor().forFrame() ($r.fields().description().render().htmlFor().forFrame()) </li> #end #end</ul>"
}
This example shows Requirements linked to Mitigation Tasks in an HTML list format.

Understanding the Bindings Property

The bindings property controls which work item becomes the $item context in your Velocity script: For downstream items (tasks, mitigations):
"bindings": "task.$item"
or
"bindings": "$1_OBJECT_ID.$item"
For upstream items (requirements, hazards):
"bindings": "harm.$item"
This allows your script to traverse relationships from linked items rather than the row item.

Common Rendering Patterns

Display Rich Text Fields

Render Polarion rich text fields with preserved formatting:
{
  "header": "Description",
  "serverRender": "$item.fields().description().render().htmlFor().forFrame()"
}

Show Filtered Linked Items

Display only specific types of linked work items:
#foreach($linkedItem in $item.fields().linkedWorkItems())
  #set($wi = $linkedItem.fields().workItem().get())
  #set($typeId = $wi.fields().type().get().id())
  #if($typeId.equals("systemrequirement"))
    <li>$wi.render().withTitle().withIcon(false).withLinks().htmlFor().forFrame()</li>
  #end
#end
Find items linked to your upstream work items:
#foreach($issue in $item.transaction().workItems().search().query("type:issue AND linkedWorkItems:${item.getReference().projectId()}/${item.getReference().id()}").sort("id"))
  <li>$issue.fields().severity().render().withIcon(true).htmlFor().forFrame()</li>
#end

Visual Flow Example

diagram
Columns with serverRender are automatically read-only. Users cannot edit the displayed content directly. To enable editing, configure separate editable columns for the source fields.
Use inline CSS styles in your serverRender HTML to control list margins, padding, and spacing. The example uses margin-block-start: -16px to align content properly within grid cells.
When rendering rich text fields containing images, you must use bindings: "task.$item" rather than task-specific bindings like bindings: "task.symbols". Otherwise, images will not render correctly.

Common Use Cases

Use CaseVelocity Method
Display rich text with formatting$item.fields().get("fieldId").render().htmlFor().forFrame()
Show linked item title with icon$wi.render().withTitle().withIcon(true).withLinks().htmlFor().forFrame()
Render field value with icon$wi.fields().severity().render().withIcon(true).htmlFor().forFrame()
Filter by work item type#if($wi.fields().type().get().id().equals("requirement"))
Query linked items$item.transaction().workItems().search().query("...")

Verification

After adding your custom data column:
  1. Refresh the RISKSHEET
  2. You should see your column displaying the rendered HTML content
  3. Verify that linked items or queried data appear as expected
  4. Check that HTML formatting (lists, links, styling) renders correctly

See Also