Risksheet Document Config File - risksheet.json - format reference

Modified on Thu, 3 Apr at 12:44 PM

This article provides a comprehensive guide on configuring the Risksheet using the risksheet.json file. It explains where the configuration file is stored and the different configuration settings it may contain.


The Risksheet loads the configuration from a file: risksheet.json


The file is searched in the following locations:

  1. As an attachment to a Risksheet document

    The system checks if there is a file "risksheet.json" attached to the Risksheet document (LiveDoc)

  2. As an attachment to a Risksheet document template

    The system checks if the custom field "templateDoc" of the Risksheet LiveDoc points to another LiveDoc document, and checks if there is a file "risksheet.json" attached to this template document.
    This is a type of configuration you can find in the demo project.

  3. If it is not found, the built-in configuration is being used


Follow this guide to learn how to upload the modified configuration.


TABLE OF CONTENTS


File Reference

Culture

By default, Risksheet formats (and edits) data using the American English culture. The decimal symbol is a period, the thousand separator is a comma, and the days of the week are "Sunday" through "Saturday", etc...

...
  "global":{
    "culture":"en"
  },
...
JavaScript

For supported options, check this detailed article.



Reviews

Define a review method for your project if needed. 


By default, this feature is disabled. To enable it, check this detailed article. 



Headers

Column and Group Header

Specify the height of the column and column group headers.

....
  "headers": {
    "columnHeader": { 
      "height": 52
    },
    "columnGroupHeader": {
      "height": 42
    }
  },
...
JavaScript


Row Header

Specify the function that sets the header style.

...."headers":{  "rowHeader":{    "renderer":"rowHeaderRpnNew"  }   },...  
JavaScript


For a deeper dive into the topic, check out our detailed article here.



Formulas

Define the formulas for calculated columns.

...
"formulas":{
  "commonRpn":"function(info){\n var value = info.item['occ']*info.item['det']*info.item['sev'];\n return value?value:null;}",
  "commonRpnNew":"function(info){\n var value = info.item['occNew']*info.item['detNew']*info.item['sevNew'];\n return value?value:null; }"        
}, 
...  
JavaScript

The functions receive a single parameter - the above-mentioned "info":

  • info.item - a data array that holds the values of the input table row. So in your formula, you can access the row (item) values by calling info.item[column.id]
  • info.cell - an HTML DOM element, usually not used in formulas, but this is typically used in cellDecorators

For a deeper dive into the topic, check out our detailed article here.



Cell Decorators

Defines the functions that return styles. Because the cells are being reused, you should not set the styles directly but only toggle the HTML class attribute.

...
"cellDecorators":{ 
   		"rpn":"function(info){\n var val = info.value;\n $(info.cell).toggleClass('rpn1', val>0 && val <= 150 );\n $(info.cell).toggleClass('rpn2', val>0 && val > 150 && val <= 250);\n $(info.cell).toggleClass('rpn3', val>0 && val > 250);}",
		"rowHeaderRpnNew":"function(info){\n var val = info.item['rpnNew'];\n $(info.cell).toggleClass('rowHeadRpn1', val>0 && val <= 150 );\n $(info.cell).toggleClass('rowHeadRpn2', val>0 && val > 150 && val <= 250);\n $(info.cell).toggleClass('rowHeadRpn3', val>0 && val > 250);}"	

  },
...  
JavaScript

The functions receive a single parameter - the above-mentioned "info":

  • info.item - a data array that holds the values of the input table row. So in your formula, you can access the row (item) values by calling info.item[column.id]
  • info.cell - an HTML DOM element, that you shall use to set the style name (see section Styles below). Do not set the inline styles directly, as the table cells are reused as you scroll the table.

For a deeper dive into the topic, check out our detailed article here.



Styles

Define the actual styles referenced by Cell Decorator Functions.

...
"styles":{
   ...
   ".rpn1":"{background-color: #B0D444 !important;}",
   ...
   }, 
... 
JavaScript

For a deeper dive into the topic, check out our detailed article here.



Columns

Define the set of columns that will be visible on the sheet.
...
 "columns": [
  ...
  {
   "headerGroup":"Potential risks",
   "header": "Controls Detection",
   "bindings": "controlsDetection",
   "id": "controlsDetection",
   "filterable":true,			
   "width": 200, 
   "level": 2
  },
  ...
 ],
... 
JavaScript

For a deeper dive into the topic, check out our detailed article here and the Column Reference below.



Levels

You can setup the tree structure, represented by merged cells. The Levels setting controls how the data (see dataTypes) relates to the columns (see the Level attribute of a column).

...
"levels": [
    {
      "name": "Row",
      "controlColumn": "cause",
      "zoomColumn": "cause"
    },
    {
      "name": "Failure",
      "controlColumn": "failure",
      "zoomColumn": "failure"
    },
    {
      "name": "Hazard",
      "controlColumn": "hazard",
      "zoomColumn": "hazard"
    },
    {
      "name": "Harm",
      "zoomColumn": "harm",
      "controlColumn": "systemItemId"
    }
  ],
...  
JavaScript

For a deeper dive into the topic, check out our detailed articles here and here.



Data Types

Currently, the Risksheet supports 2 main data types:

  1. Risk Item - better row-item
  2. Task Item - downstream dependency item (each risk row is split into sub-rows)

In addition to that, you can configure the upstream dependencies.

...
"datatypes": {
"risk": {
      "type": "risk"
    },
    "task": {
      "type": "task",
      "role": "mitigates",
      "name": "Risk Mit. Measure",
      "zoomColumn": "taskTitle"
    } 
  },
...  
JavaScript

For a deeper dive into the topic, check out our detailed article here.



Sort By

Define how data will be sorted on the Risksheet.

It is recommended to sort by one column from each level.

...
"sortBy":["item", "failureMode", "causes"] 
...  
JavaScript

For a deeper dive into the topic, check out our detailed article here.



PDF Export Configuration

Please reach out by submitting a ticket here to configure the PDF export.


For a deeper dive into the topic, check out our detailed article here.



Column Reference

Column Properties

bindings - This property defines the ID of the Work Item field (either built-in or custom)

  • It determines which field from the Work Item will populate the column
  • Common bindings include status, cause, or any custom fields created in Polarion
  • "bindings": "description"


id - The unique identifier of the column

  • By default, it is autogenerated based on the field ID
  • If a column needs to be referenced in formulas or custom renderers, it’s advisable to assign a static ID
  • "id": "item"


level - This sets the hierarchy of the column within the Risksheet

  • By default, 1 and 2 correspond to risk items
  • 3 is usually reserved for task items
  • "level": 2


type - The type property defines the format and behavior of the column data. 

  • By default, Risksheet derives the type from the Polarion field associated with the binding.
  • However, you can override it to enforce a specific format. e.g., format and edit a string field as a number.
  • "type": "int"


Below are the supported data types:


stringsingle-line text
textmulti-line text
booleantrue or false values
intwhole numbers
floatdecimal numbers
durationTime duration 
datedate-only format
datetimedate and time
timetime-only format
currencycurrency values



Advanced Types

assignee ref:user

  • Use this type if you want to see the assignees column on the Risksheet
  • How to add assignee column
  • "bindings": "task.assignee"

    "type": "ref:user"


cellCss - The name of the style that is applied to the cells in this column.

  • The style is defined in the styles section in the same config file


cellRenderer - A reference to a function defined in the "cellDecorators" section in the same config file. 

  • The function usually returns the style name based on the data in the cell


collapseTo - Defines which column remains visible


enumerationsenum:ENUMID/multiEnum:ENUMID

  • Select the appropriate value from a drop-down list right on the Risksheet.
  • Using enumerations, you can see easily all available options and f.
  • You should define the enumeration in Administration first. 


For creating Enumeration columns for Upstream or Downstream items, you need to specify additionally the Work Item type.

  • As a result, it should look like: "type":"enum:task-testEnum", where 'task' is a Work Item ID and 'testEnum' is an Enum ID.


Starting with version 25.3.1Dependent enumerations are supported in Risksheet.

  • Custom fields with single enumeration values dependent on another field (e.g., cascading dropdowns) are now supported
  • Once a value is selected in the parent field, the dependent enumeration is filtered accordingly. This behavior now matches native Polarion functionality
  • Multi-enums are not yet supported
  • If the driving fields are not shown, then dependent enums are not honored


filterable - Determines if the column will be filterable

  • "filterable": true/false


format - Specifies the data format


formula -  A reference to a function defined in the Formulas section above.

  • The function computes the value presented in the cell


header - Column title

  • Avoid placing side-by-side columns with the same header, as they will merge into a single column header
  • "header": "Release"


headerTooltip - Tooltip assigned to the column title


headers - The style's name applied to the column title

  • The style is defined in the styles section in the same config file


headerGroupTitle of the Column group

  • The column titles can be grouped
  • "headerGroup": "Release"


headerGroupTooltip - Column group title tooltip


headerGroupCss - The name of the style that is applied to the column group title

  • The style is defined in the styles section in the same config file


minWidth - Defines the minimum width of a column

  • The column cannot be resized to a width smaller than this value
  • Autosize columns (width="*") will also not be smaller than this width
  • "minWidth": 170


ratingrating:ENUMID

  • Ratings, as well as enumerations, are used to select and change data in a drop-down list
  • Using ratings, you can specify the importance of data from the input for further risk evaluation


readOnly -  By default, it is derived from work item permissions.

  • But you can enforce the column to be read-only manually. 
  • (You cannot overwrite the permissions - if the column is read-only in Polarion you cannot mark it editable on the Risksheet)
  • "readOnly":true/false


Starting with version 25.2.0, there is an exception where "readOnly":true will be ignored

  • When creating a new Item in the title columns, you can write the titles even when the column is set to read-only


referenceitemLink/multiItemLink


width - the default width of the column

  • "width": 150



For any assistance, please don’t hesitate to reach out by submitting a ticket here.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article