Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • the "value" output is always null
  • the "values" array may contain zero or more values
  • setting the field with the "value" parameter will overwrite any existing values, and replace it with a single value.
  • setting the field with the "valuesToSet" parameter will overwrite any existing values, and replace it with a set of values
  • setting the field with the "valuesToAdd" parameter will retain any existing values, and append the provided values
  • setting the field with the "valuesToRemove" parameter will retain any existing values, except the provided values which will be removed (if set)

Advanced field options

Using Field Access Control

The Administrator may change the Field Definition, setting the readRole or writeRole to either "user", "tech", or "admin".

To change the access mode of the field:

No Format
curl -XPUT -H"Argus-API-Key:$key" https://api.mnemonic.no/cases/v2/field/descriptor/myNewField -d '
{
  "readRole":"user",
  "writeRole":"tech"
}'


The access control works according to this table:


readRolewriteRole
userAll users that can view the case, can view the value of this fieldAll users that can write to the case, can change the value of this field
techOnly users with tech role for the case can view the value of this fieldOnly users with tech role for the case, which also has write permissions to the case, can view the value of this field
adminOnly users with service admin for this case can read the value of this fieldOnly users with service admin for this case can write the value of this field

Using Field Validators

The field can be configured to only allow values permitted by a "validator". This can be used to increase the data consistency of the field.

The possible validation rules depend on the value type:

Value TypeValidatorExample
integerType

minimum - Minimum value to allow

maximum - Maximum value to allow



No Format
"validator": { "integerSettings": { "minimum": 0, "maximum": 10 } }
floatType

minimum - Minimum value to allow

maximum - Maximum value to allow

No Format
"validator": { "floatSettings": { "minimum": 0.0, "maximum": 1.0 } }
stringType

regex - Value must match regular expression 

maxLength - Value cannot exceed this length

No Format
"validator": { "stringSettings": { "regex": "string", "maxLength": 10 } }
textTypemaxLength - Value cannot exceed this length
No Format
"validator": { "textSettings": { "maxLength": 10 } }
ipTypeipVersion - The permitted IP version
No Format
"validator": { "ipSettings": { "ipVersion": "IPv4" } }
subjectType

subjectType - user or group

requiredPermission - Only permit subjects having this permission

sameCustomer - Only permit subjects belonging to same customer as the current case

memberOf - Only permit subjects which are member of the specified group

No Format
{"subjectSettings": { "subjectType": "user", "requiredPermission": "string", "sameCustomer": true, "memberOf": 0}}
caseType

service - only permit cases for this service

caseType - only permit cases of  this type

category - only permit cases of this category

sameCustomer - only permit cases belonging to same customer as the current case

No Format
{ "caseSettings": { "service": "string", "caseType": "securityIncident", "category": "string", "sameCustomer": true} }


Using Field Value Sources

...

A field source can be a static list of values, or reference an external endpoint.

Configuring a list sourceConfiguring an external source
No Format
  "valueSource": {
    "listType": {
      "entries": [
        { "key":"a", "label":"Category A" },
        { "key":"b", "label":"Category B" },
        { "key":"c", "label":"Category C" }
      ]
    }
  },

Valid values are now "a", "b" or "c", but these values will be rendered with the corresponding label.

No Format
  "valueSource": {
    "urlType": {
      "queryURL": "https://my.service/lookup?value=%s"
    }
  },

The endpoint must return a JSON array containing objects, each object with a property key and label

The endpoint will be invoked with the %s replaced with an autocompleter input.
It will also be invoked with the exact value when a field value is set, or to fetch the label of the current value. Any filtering on the provided parameter must therefore also return exact key match.