Risksheet Document Config File - risksheet.json - format reference

Modified on Fri, 16 Feb 2024 at 01:12 PM

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


The file is searched in the following locations:

  1. attachment to a risksheet document

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

  2. attachment to a risksheet document template

    The system checks if the custom field "templateDoc" of the risksheet LiveDocument 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 not, the built-in configuration is being used


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


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...


For supported options  see https://nextedy.freshdesk.com/en/support/solutions/articles/48001172966-countries-supported-in-the-globalization-cultures



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


Reviews

Define a review method for your project if needed. 

By default, this feature is disabled.


See: How to setup risk review process

Headers

Column and Group Header

Specify the height of the column and column group headers.


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


Row Header

Specify the function that sets the header style.

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


See: Configure the style of the row header


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; }"        
},
...

The functions receive a single parameter - above named "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 used typically in cellDecorators

See: Configure calculated column (formula)



Cell Decorators

Define 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);}"	

  },
...

The functions receive a single parameter - above named "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.

See:  Configure cell/column styles


Styles

Define the actual styles that are referenced by Cell Decorator Functions (see above).

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

See:  Configure cell/column styles


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
  },
  ...
 ],
...

See:  Add / Configure a risksheet column


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"
    }
  ],
...

See: 


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 of course configure the up-stream dependencies.

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


Sort By

Define how data will be sorted on the Risksheet.

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

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


PDF Configuration

Please, contact us at support@nextedy.com to configure the pdf export.



Column Reference

Column Properties


bindings:  the id of the work item built-in or custom field (status, cause, ...)


level: a number 1, 2, or 3. By default - 1 and 2 correspond to the risk items. 3 corresponds to a level 3 item type, usually a task. 

See: What Work Items are visible on Risksheet


id: the id of the column. Usually autogenerated from the ID. If you need to refer to the column from formulas or renderers, give it a static ID.


type: the type is usually autogenerated from the type of the Polarion field (see bindings). But you may overwrite it, i.e. you can tell risksheet to e.g. formate and edit string field as a number.  The supported values are:

  • string - single-line text
  • text - multi-line text
  • boolean - true/false
  • int -  number
  • float - number
  • duration - Polarion time duration type
  • date - date only 
  • datetime - date and time
  • time - time only
  • currency - currency

There are also some advanced types:

  • Enumerations:

enum: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.

    Note! You should define the enumeration in Administration first. 


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

As a result, it should look like: 

"type":"enum:task-testEnum", where 'task' is a WI ID and 'testEnum' is an Enum ID.


  • Assignee:

ref:user

Use this type if you want to see the assignees column on the Risksheet. 

See: How to add assignee column

  • Ratings:

rating: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.

  • Reference:

itemLink

multiItemLink



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)


format: specify the data format. See Column Data Formats


formula: a reference to a function defined in the "formulas" section above. The function computes the value presented in the cell.


header: Column title

    Note! You shouldn't put side-by-side columns with the same header. In that case, they will merge into just one column header.


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 (risksheet.json).


headgroup: Title of the Column group (the columns titles can be grouped)


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 (risksheet.json).


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 (risksheet.json).


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.


width [number]: the default width of the column


minWidth: the minimal column width, it cannot be dragged to be smaller. Autosize columns (width="*") will also be not smaller than this width.


filterable: true/false - should there be a filter in the column header.


collapseTo: true/false - define which column remains visible. 

See: How to Collapse Column Groups

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 atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article