Skip to main content

Enable Work Item-Based Reviews

Add the following configuration to your risksheet.json file:
{
  "global": {
    "culture": "en"
  },
  "reviews": {
    "reviewManager": "WorkItemBased",
    "typeProperties": {
      "linkTypes": "review",
      "linkRole": "review_link",
      "query": "NOT status:closed",
      "document": "PROJECT_ID/DOCUMENT_ID",
      "itemTemplate": "<span class=\"risk_reviews\"><b>$item.render().withLinks().htmlFor().forFrame()</b> by $item.fields().author().render().htmlFor().forFrame() [$item.fields().status().render().withIcon(false).htmlFor().forFrame()]<br/>$item.fields().description().render().htmlFor().forFrame()</span>"
    }
  }
}
Work item-based reviews require both linkTypes (the work item type ID for reviews) and linkRole (the link role name). Missing either property will cause runtime errors when attempting to create reviews.

Configuration Properties

Mandatory Properties

PropertyDescriptionExample
linkTypesPolarion work item type ID for review items"review" or "reviewTask"
linkRoleLink role name connecting reviews to risk items"review_link" or "reviews"

Optional Properties

PropertyDescriptionExample
queryLucene query to filter displayed reviews"NOT status:closed" or "status:open OR status:in_review"
documentTarget document for review work items (SPACE/DOC format)"ACC/ReviewDoc"
projectTarget project for review work items"safety_project"
itemTemplateVelocity template for custom review renderingSee template examples below
All properties support Velocity expression evaluation. Use $doc.getReference().projectId() to dynamically set the project based on the current document’s project.

How Work Item-Based Reviews Work

diagram When a user creates a review:
  1. 📄 A new work item is created (type specified by linkTypes)
  2. The review work item is linked to the risk item (using linkRole)
  3. The review is stored in the specified document or project
  4. • The review appears in RISKSHEET according to itemTemplate

Custom Review Templates

Default Template

If no itemTemplate is specified, reviews display:
  • Work item ID (as clickable hyperlink)
  • Author name
  • Creation timestamp
  • Title (if different from description)
  • Description (HTML-rendered)

Custom Template Example

"itemTemplate": "<div class='review-card'><strong>Review $item.id()</strong> by $item.fields().author().render().htmlFor().forFrame() on $item.fields().created().render().htmlFor().forFrame()<br/><span class='review-status'>[$item.fields().status().render().withIcon(true).htmlFor().forFrame()]</span><br/>$item.fields().description().render().htmlFor().forFrame()</div>"
This template creates a formatted card-style display with work item ID, author, creation date, status with icon, and description.

Query Filtering

Use the query property to control which reviews appear in RISKSHEET:
// Show only open and in-progress reviews
"query": "status:open OR status:in_review"

// Exclude closed and rejected reviews
"query": "NOT (status:closed OR status:rejected)"

// Show reviews assigned to specific users
"query": "assignee:(jsmith OR mdoe)"
The query is combined with the link-based filter, so only linked reviews matching the query will display.

Cross-Project Reviews

Store reviews in a different project than the risk items:
"reviews": {
  "reviewManager": "WorkItemBased",
  "typeProperties": {
    "linkTypes": "review",
    "linkRole": "review_link",
    "project": "review_tracking_project"
  }
}
This centralizes all review work items in a dedicated tracking project while maintaining links to risk items in their original projects.
When document is specified, new reviews are automatically positioned after the last existing review of the same type in the document structure, maintaining sequential order.

Add a Review Display Column

Add a column to display reviews:
"columns": [
  {
    "id": "reviews",
    "title": "Reviews",
    "binding": "reviewsRendered",
    "width": 350
  }
]
The reviewsRendered binding retrieves linked review work items, applies the query filter, and renders them using itemTemplate.

Verify Your Configuration

  1. Save your risksheet.json configuration with required linkTypes and linkRole
  2. Refresh your RISKSHEET page
  3. Create a test review for a risk item
  4. Verify in Polarion:
    • A new work item of type linkTypes was created
    • The work item is linked to the risk item via linkRole
    • The work item appears in the specified document or project
  5. Return to RISKSHEET and confirm the review displays in the review column
You should now see review work items displayed according to your itemTemplate, with filtering applied based on your query expression.

See Also

KB ArticlesSource Code
  • WorkItemBasedReview.java
  • IReview.java
  • AppConfig.ts
  • SystemConsts.java
  • CommentBasedReview.java