PAScorecard - Scoped

The PAScorecard API allows you to query information about Performance Analytics scorecards and indicators.

PAScorecard - addParam(String parameter, String value)

Add a query parameter to filter the returned scores.

Call this method multiple times on the same PAScorecard object to pass multiple parameters, such as the indicator sys_id and a breakdown sys_id. After specifying all parameters, call query() to run the query and get the resulting scorecard object.

Table 1. Parameters
Name Type Description
parameter String The parameter to set. For a detailed list of available parameters, see PAScorecard parameters.
value String The value to assign to the specified parameter.
Table 2. Returns
Type Description
void
var sc = new SNC.PAScorecard(); //in a scoped app, do not use the SNC namespace
sc.addParam('uuid', 'fb007202d7130100b96d45a3ce6103b4');       // Number of open incidents
sc.addParam('breakdown', '0df47e02d7130100b96d45a3ce610399');  // by Priority
var result = sc.query();
var json = sc.asJSON();
for (var i = 0; i < result.length; i++)
gs.info(result[i].name + ': ' + result[i].value + ' ' + result[i].unit.display_value);

PAScorecard - asJSON()

Get the latest query result as a JSON string.

This method does not perform a query. To perform a query before returning the result, use query().

Table 3. Parameters
Name Type Description
None
Table 4. Returns
Type Description
String A JSON representation of the query result.

PAScorecard - query()

Perform a query based on the specified parameters and return the scorecard as an object.

Before calling this method, configure parameters for the PAScorecard object by calling addParam(String parameter, String value).

Table 5. Parameters
Name Type Description
None
Table 6. Returns
Type Description
Object The scorecard object.

PAScorecard - result()

Get the latest query result as an object.

This method does not perform a query. To perform a query before returning the result, use query().

Table 7. Parameters
Name Type Description
None
Table 8. Returns
Type Description
Object The scorecard object from the last query.