About using JSON training rules

It is possible to define rules directly in JSON. This can be useful if you want to test and simulate a rule before applying it.

Location

You can define your JSON rules in: Confluence administrationGeneral configurationRADBEETraining Genius Configuration.

You can see the rules in the Filter field, but you can't edit them there. First you have to export them to a text file, which should have a ".rules" extension. You can open this file with any text editor to make the changes.

JSON structure

The JSON rules structure starts with the root element rules inside of which you always define four parts:

  • "name": This element is purely for identifying purposes. Its value should be a string.

  • "pageFilter": This element defines which pages are considered training pages.
  • "userFilter": This element defines which users are required to complete the training.
  • "ruleTypes": This element defines how often or under which circumstances the training should occur.

Example

{
    "rules": [
        {
            "name": "Default rule",
            "pageFilter": {
                "type": "PAGE_SPACE_KEY",
                "value": "Documents"
            },
            "userFilter": {
                "type": "USER_GROUP",
                "value": "training_group"
            },
            "ruleTypes": {
                "ruleType": "NOT_TRAINED_PAGE_VERSION"
            }
        }
    ]
}


You can use multiple rule sets within the same "rules" root element. This way you can make different rules for multiple spaces on your Confluence and/or notify a different group of users each time.

Just make sure to give each rule a unique name so you can tell the difference at a glance.

Rules diagram