Assessment methods

The available methods are Assessment, for non-scripted metrics, and Script, for scripted metrics. Each method serves a different function and can be used with certain data types.

Use the Method field to specify how to use the metric.

Assessment method

Metrics with the Method set to Assessment are called non-scripted metrics. Use each non-scripted metric to define a question for assessment questionnaires. Non-scripted metrics are useful if you want to obtain subjective data like personal opinions.

You can use the Assessment method with these Data type values:
  • Attachment
  • Checkbox
  • Choice
  • Date
  • Date/Time
  • Likert Scale
  • Number
  • Percentage
  • String
  • Template
  • Yes/No

Script method

Metrics with the Method set to Script are called scripted metrics. Use each scripted metric to define a custom script for database queries. Scripted metrics are useful if your system contains reliable data for the traits you want to evaluate.

You can use the Script method with these Data type values:
  • Duration
  • Number
  • Percentage
Use the Script field to write JavaScript code. By default, the field contains information about available variables and an example, which you can use as the basis of your script or replace entirely:
Figure 1. Metric form script field
You must use the following variables in your script:
  • primary: Input variable used to access the sys_id of the record being assessed.
  • actual_result: Output variable that contains the actual value for this metric. The system uses this variable to populate the Actual value field on the Metric Result form. For each actual_result, you must specify a corresponding scaled_result value.
  • scaled_result: Output variable that contains a numerical scaled value to represent an actual value. The system uses this variable to populate the Scaled value field on the Metric Result form. Ensure the scaled values you specify are between or equal to the Min and Max values for the metric. The Scale definition field determines how the system uses the scaled value. A scale definition of Low means smaller numbers are better, such as for a metric that measures the number of incidents for a vendor. High means larger numbers are better, such as for a metric that measures user satisfaction on a scale of one to five.

Script example

The metric Number of active devices uses the script pictured below. The primary variable is used to find CIs that are associated to the vendor record being assessed. The script retrieves the actual_result, the number of CIs associated to the vendor, then calculates the correct scaled_result. The script uses a series of scaled values, from the Min to the Max value, to represent actual values. Because the Scale definition is set to High, the greatest scaled values are best, meaning a vendor associated to the most CIs scores highest. The system stores the actual and scaled values in a metric result record for the vendor.
Figure 2. Scripted metric example