Skip to main content

Prerequisites

  • Nextedy RISKSHEET version 23.10.5 or later
  • Polarion Test Management configured in your project
  • Test Runs linked to work items in your Risksheet

Add Test Results Column

Open your risksheet.json configuration and add a server-rendered column with the following structure:
{
  "headerGroup": "Mitigations",
  "headerGroupCss": "headMitigations",
  "headerCss": "headMitigations",
  "header": "Test Result",
  "bindings": "task.$item",
  "minWidth": 170,
  "serverRender": "#macro(getLastTestRecord $item)#set( $testRecords = $testManagementService.getLastTestRecords($item.getOldApi(), 1) ) #foreach ($iRecord in $testRecords)#set($testRun = $transaction.testRuns().getBy().oldApiObject($iRecord.getTestRun()))$iRecord.getTestRun().getId() - $iRecord.getResult().name , #end#end #getLastTestRecord($item)"
}

Configuration Breakdown

diagram The serverRender property contains a Velocity macro that:
  1. Defines getLastTestRecord macro accepting the work item
  2. Calls $testManagementService.getLastTestRecords($item.getOldApi(), 1) to retrieve the most recent test record
  3. Loops through test records using #foreach
  4. Fetches the Test Run object via $transaction.testRuns().getBy().oldApiObject()
  5. Renders the Test Run ID and result status (e.g., “TR-1234 - passed”)
Change the second parameter from 1 to a higher number to retrieve more historical test records:
$testManagementService.getLastTestRecords($item.getOldApi(), 5)

Customize Result Display

You can modify the Velocity template to format results differently:

Show Only Status

"serverRender": "#macro(getLastTestRecord $item)#set( $testRecords = $testManagementService.getLastTestRecords($item.getOldApi(), 1) ) #foreach ($iRecord in $testRecords)$iRecord.getResult().name #end#end #getLastTestRecord($item)"

Add Conditional Formatting

"serverRender": "#macro(getLastTestRecord $item)#set( $testRecords = $testManagementService.getLastTestRecords($item.getOldApi(), 1) ) #foreach ($iRecord in $testRecords)#if($iRecord.getResult().name == 'passed')✅ #else #end$iRecord.getResult().name #end#end #getLastTestRecord($item)"
Columns using serverRender display dynamically generated content and cannot be edited directly. Users must update test results through Polarion’s Test Management interface.

Apply Column to Specific Levels

If your Risksheet uses hierarchical levels, specify which level displays the test results:
{
  "header": "Test Result",
  "bindings": "task.$item",
  "level": 2,
  "serverRender": "..."
}
The level property controls at which hierarchy tier the column appears (typically level 2 for mitigation/task rows).

Verification

  1. Save your risksheet.json configuration
  2. Reload your Risksheet document
  3. You should now see a Test Result column displaying test run IDs and status values like “TR-1234 - passed” or “TR-5678 - failed”
  4. Results update automatically when test runs are executed in Polarion

Common Use Cases

ScenarioConfiguration
Show last test status onlyRemove $iRecord.getTestRun().getId() - from template
Display multiple test runsChange getLastTestRecords(..., 1) to higher number
Filter by test typeAdd conditional logic in Velocity macro
Show execution dateAccess $iRecord.getExecuted() in template
If your Risksheet contains many work items, retrieving test records for every row can impact load time. Consider using personal filters to reduce the visible row count when working with test data.

See Also