Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

Service Test Management Open API

The Service Test Management Open API provides endpoints to create and retrieve service test definitions and service tests.

Use this API to manage service problem management information between external systems and the ServiceNow AI Platform. The Service Test Management Open API is a ServiceNow implementation of the TM Forum Service Problem Management API REST specification. This implementation is based on the TMF653 Service Test Management API User Guide v4.1.0, July 2021.

This REST API is designed to manage and execute service tests within a telecommunications environment. It allows users to define, trigger, and monitor service tests, ensuring that services meet quality and performance standards. The API provides capabilities for test management, including creating and updating test definitions, executing tests, retrieving test results, and managing test schedules.

The Service Test Management Open API requires the Customer Service Problem Management (com.sn_sprb_mgmt) application, which is available on the ServiceNow Store. For more information, see Customer Service Problem Management.

This API runs in the sn_sprb_mgmt namespace. The calling user must have the sn_sprb_mgmt.test_integrator role.

The Service Test Management Open API creates or updates data in the following tables:

  • Test Run [sn_st_mgmt_test]
  • Service Test definition [sn_st_mgmt_test_definition]
  • Test Definition Characteristic [sn_st_mgmt_test_definition_characteristic]
  • Test Characteristic [sn_st_mgmt_test_characteristic]
  • Specification to Test Definition Relationship [sn_st_mgmt_test_definition_m2m]
  • Test Definition Relationship [sn_st_mgmt_test_definition_rel]
  • Test Measure [sn_st_mgmt_test_measure]
  • Measure Consequence [sn_st_mgmt_measure_consequence]
  • Test Measure Definition [sn_st_mgmt_test_measure_definition]
  • Applied Consequence [sn_st_mgmt_applied_consequence]
  • Threshold Rule [sn_st_mgmt_threshold_rule]
  • Threshold Rule Violation [sn_st_mgmt_threshold_rule_violation]

Parent Topic:REST API reference

Service Test Management Open API – GET /sn_sprb_mgmt/servicetestmanagement/serviceTest

Retrieves a list of all service tests.

URL format

Default URL: /api/sn_sprb_mgmt/servicetestmanagement/serviceTest

Supported request parameters

NameDescription
None 
NameDescription
fieldsList of fields to return in the response. Invalid fields are ignored. If this parameter isn't used, all fields are returned. Located in the Service Test \[sn\_st\_mgmt\_test\] table.Valid fields: - characteristic - description - endDateTime - id - mode - relatedService - startDateTime - state - testMeasure - testSpecification - validFor Data type: String
limit

Maximum number of records to return. For requests that exceed this number of records, use the offset parameter to paginate record retrieval.Data type: Number

Maximum value: 100

Default: 20

offsetStarting index at which to begin retrieving records. Use this parameter to paginate results in small and manageable chunks. The first record is indexed at 0.Data type: Number Default: 0
stateFilter test definitions by the test's current state. Only test definitions in the specified state are returned in the response.Valid values: - acknowledged - canceled - completed - failed - inProgress - pending - rejected Data type: String
NameDescription
None 

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

HeaderDescription
None 
HeaderDescription
Content-RangeSpecifies the range of content returned in a paginated call.For example, if `offset=2` and `limit=3`, the value of the Content-Range header is items `3-5`.
Content-TypeData format of the response body. Only supports application/json.
LinkContains the following links to navigate through query results.- first - last - next - previous
X-Total-CountFor paginated queries, this header specifies the total number of records available on the server.

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Status codeDescription
200Successful. The request was successfully processed.
206Partial resource returned in response (with pagination).
400Bad Request. A bad request type or malformed request was detected.
404Not found. The requested item wasn't found.
NameDescription
characteristicList that describes the characteristics of the associated service test. For more information about test definition characteristics, see Data type: Array of Objects
"characteristic": [
 {
  "id": "String",
  "name": "String",
  "value": "String",
  "valueType": "String"
 }
]
characteristic.idSys\_id or external\_id of characteristics. If external\_id is present for that record, the response returns the external\_id otherwise it returns the sys\_id.Data type: String Table: Characteristics \[sn\_prd\_pm\_characteristic\]
characteristic.nameName of the characteristic.Data type: String
characteristic.valueCharacteristic options associated with the service test. Characteristics vary based on the customer instance.Data type: String
characteristic.valueTypeType of characteristic value.- choice - date - date/time - duration - email - label - single line test - yes/no Data type: String
descriptionDescription of the service test.Data type: String
endDateTimeEnd date and time of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
hrefHyperlink reference to the service test.Data type: String
idSys\_id or external\_id of the service test definition.Data type: String Table: Service Test \[sn\_st\_mgmt\_test\]
modeMode that the service test is running in.Valid values: - ONDEMAND: Triggers the service test manually. - PROACTIVE: Triggers the service test automatically. Data type: String Default: ONDEMAND
nameRequired. Name of the service test.Data type: String
relatedServiceRequired. Test definition associated with the service test.Data type: Object
"relatedService": {
 "href": "String",
 "id": "String",
 "name": "String"
}
relatedService.idSys\_id or external\_id of the product inventory.Data type: String Table: In the sys\_id or external\_id field of the product Inventory \[sn\_prd\_invt\_product\_inventory\] table.
relatedService.nameName of the product inventory.Data type: String
startDateTimeStart date and time of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
stateState the service test is in. Valid values: - acknowledged - canceled - completed - failed - inProgress - pending - rejected Data type: String
testMeasureMeasure of a specific aspect of a product, service, or resource test, such as lost packets or connectivity status.Data type: Array of Objects
"testMeasure": [
 {
 "accuracy": "String",
 "captureDateTime": "String",
 "captureMethod": "String",
 "id": "String",
 "metricDescription": "String",
 "metricName": "String",
 "ruleViolation": [Array],
 "unitOfMeasure": "String",
 "value": {Object}
 }
]
testMeasure.accuracyFloat decimal value representing the test measure accuracy captured for the associated metrics.Data type: Number Maximum value: 40
testMeasure.captureDateTimeThe date and time that the metric was captured. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
testMeasure.idSys\_id or external\_id of the Test Measures.Data type: String Table: In the sys\_id or external\_id fields of the Test Measures table \[sn\_st\_mgmt\_test\_measure\] table.
testMeasure.Measure.captureMethodMethod used to capture the metric.Valid values: - automatic: Automatically capture the metric. - manual: Manually capture the metric. - none: Don't capture the metric. Data type: String
testMeasure.metricDescriptionBrief description of the metric.Data type: String
testMeasure.metricNameName of the test measure metric.Data type: String
testMeasure.ruleViolationAn object for defining a rule in the threshold rule definition, along with consequences if the rule is violated.Data type: Array of Objects
"ruleViolation"[
  {
    appliedConsequence: [Array],
    conformanceTargetUpper: Number,
    conformanceComparatorUpper: "String",
    description: "String",
    id: "String",
    name: "String",
    numberOfAllowedCrossing: Number,
    thresholdRuleSeverity: "String",
    tolerancePeriod: "String"
  }
]
testMeasure.ruleViolation.tolerancePeriod.amountNumber of periods before applying the consequence.Data type: Number
testMeasure.ruleViolation.appliedConsequenceAction \(prescribed action or notification\) to take when a threshold rule is crossed.Data type: Array of Objects
"appliedConsequence": [
 {
  "appliedAction": "String",
  "description": "String",
  "id": "String",
  "name": "String",
  "repeatAction": Boolean
 }
]
testMeasure.ruleViolation.appliedConsequence.appliedActionAction to take when a threshold rule is violated. For example, sending a warning or generating a report. Applied actions can vary between instances.Data type: String
testMeasure.ruleViolation.appliedConsequence.descriptionDescription of the applied consequence.Data type: String
testMeasure.ruleViolation.appliedConsequence.idSys\_id or external\_id of the applied consequence.Data type: String
testMeasure.ruleViolation.appliedConsequence.nameName of the applied consequence.Data type: String
testMeasure.ruleViolation.appliedConsequence.repeatActionFlag that indicates whether to repeat the consequence when a second violation occurs.Valid values: - true: Repeat the action. - false: Don't repeat the action. Data type: Boolean Default: false
testMeasure.ruleViolation.conformanceComporatorExactFlag that indicates whether a value is identical.Valid values: - true: The value is identical. - false: The value isn't identical. Data type: Boolean Default: false
testMeasure.ruleViolation.conformanceComporatorLowerOperator for checking if a value falls below the threshold.Valid values: - greater than - greater than or is Data type: String
testMeasure.ruleViolation.conformanceComporatorUpperOperator for checking if a value is above the threshold.Valid values: - less than - less than or is Data type: String
testMeasure.ruleViolation.conformanceTargetExactRequired if conformanceComparatorExact is set to true. If the conformanceComparatorExact value is set to true, its value matches the value defined in conformanceTargetExact.Data type: Number
testMeasure.ruleViolation.conformanceTargetLowerLower threshold value for comparing the test measure results. Determines if the threshold is crossed or no longer crossed.Data type: Number
testMeasure.ruleViolation.conformanceTargetUpperUpper threshold value for comparing the test measure results. Determines if the threshold is crossed or no longer crossed.Data type: Number
testMeasure.ruleViolation.descriptionDescription of the threshold rule.Data type: String
testMeasure.ruleViolation.idSys\_id or external\_id of the threshold rule violation.Data type: String Table: Threshold Rule Violation \[sn\_st\_mgmt\_threshold\_rule\_violation\]
testMeasure.ruleViolation.nameName of the threshold rule.Data type: String
testMeasure.ruleViolation.numberOfAllowedCrossingMaximum crossings allowed within the tolerance period before consequences are applied.Data type: Number Maximum value: 40
testMeasure.ruleViolation.thresholdRuleSeveritySeverity of the threshold rule.Valid values: - high - medium - low Data type: String
testMeasure.ruleViolation.tolerancePeriodSpecified time interval during which crossing occurrences are enabled without triggering any immediate consequences or actions.Date type: Object
"tolerancePeriod": {
 "amount": Number,
 "units": "String"
}
testMeasure.ruleViolation.tolerancePeriod.unitsUnits of the period.Valid values: - days - hours - minutes - seconds Data type: String
testMeasure.unitOfMeasureUnit of measurement for the conformance target values of the test measure.Data type: String
testMeasure.valueValue of the test measure.Data type: Object
"value": {
 "id": "String",
 "name": "String",
 "valueType": "String",
 "value": "String
}
testMeasure.value.idID of the test measure value.Data type: String
testMeasure.value.nameName of the test measure value.Data type: String
testMeasure.value.valueValue of the test measure.Data type: String
testMeasure.value.valueTypeType of test measure value such as numeric, text, and so forth.Data type: String
testSpecificationRequired. Test definition associated with this test. Data type: Object
"testSpecification": {
 "href": "String",
 "id": "String"
}
testSpecification.hrefHyperlink reference to the service test definition.Data type: String
testSpecification.idSys\_id or external\_id of the service test definition.Data type: String Table: In the sys\_id or external\_id field of the Service Test Definition \[sn\_st\_mgmt\_test\_definition\] table.
validForDate range the service test is valid for.Data type: Object
"validFor": {
 "endDateTime ": "String",
 "startDateTime": "String"
}
validFor.endDateTimeValidity end date of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
validFor.startDateTimeValidity start date of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.

cURL request

The following example retrieves information about the two service tests in the instance.

curl --location --request GET “https://instance.servicenow.com/api/sn_sprb_mgmt/servicetestmanagement/serviceTest” \
--user 'username’: ‘password'

Response body.

[
  {
    "href": "/api/sn_sprb_mgmt/servicetestmanagement/serviceTest/09d1f42e3be28210d140068aa4e45ae2",
    "id": "09d1f42e3be28210d140068aa4e45ae2",
    "description": "Service test",
    "endDateTime": "2025-01-31 15:05:43",
    "mode": "proactive",
    "name": "Speed Test TR0001002",
    "startDateTime": "2024-06-05 09:07:10",
    "validFor": {
      "startDateTime": "",
      "endDateTime": ""
    },
    "relatedService": {
      "id": "fa6d13f45b5620102dff5e92dc81c77f",
      "name": "Internet_VPLS_PI0000011"
    },
    "testSpecification": {
      "href": "/api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/7d3854864316c6500e51203d5fb8f2d8",
      "id": "7d3854864316c6500e51203d5fb8f2d8"
    },
    "characteristic": [],
    "testMeasure": [
      {
        "id": "61d1382e3be28210d140068aa4e45a2e",
        "accuracy": "0.0001",
        "captureDateTime": "",
        "captureMethod": "automatic",
        "metricDescription": "",
        "metricName": "Flow speed",
        "unitOfMeasure": "A second",
        "value": "3000",
        "ruleViolation": [
          {
            "id": "61d1382e3be28210d140068aa4e45a2f",
            "description": "This speed is greater than the target",
            "name": "tooMuchTraffic",
            "numberOfAllowedCrossing": "0",
            "thresholdRuleSeverity": "high",
            "tolerancePeriod": "",
            "conformanceTargetLower": "2500",
            "conformanceComparatorLower": "greater than",
            "appliedConsequence": [
              {
                "id": "65d1382e3be28210d140068aa4e45a31",
                "appliedAction": "sendWarning",
                "description": "send a warning to the system",
                "name": "sendWarning",
                "repeatAction": "0"
              }
            ]
          }
        ]
      }
    ]
  },
  {
    "href": "/api/sn_sprb_mgmt/servicetestmanagement/serviceTest/18682a2a3b2682107222bf9985e45a55",
    "id": "18682a2a3b2682107222bf9985e45a55",
    "description": "Service test",
    "endDateTime": "2025-01-31 15:05:43",
    "mode": "proactive",
    "name": "Speed Test TR0001012",
    "startDateTime": "2024-06-05 17:45:07",
    "validFor": {
      "startDateTime": "",
      "endDateTime": ""
    },
    "relatedService": {
      "id": "fa6d13f45b5620102dff5e92dc81c77f",
      "name": "Internet_VPLS_PI0000011"
    },
    "testSpecification": {
      "href": "/api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/7d3854864316c6500e51203d5fb8f2d8",
      "id": "7d3854864316c6500e51203d5fb8f2d8"
    },
    "characteristic": [
      {
        "id": "5c682a2a3b2682107222bf9985e45a5a",
        "name": "url",
        "valueType": "single_line_text",
        "value": "http://abc.com"
      }
    ],
    "testMeasure": [
      {
        "id": "7c686a2a3b2682107222bf9985e45a4d",
        "accuracy": "0.0001",
        "captureDateTime": "",
        "captureMethod": "automatic",
        "metricDescription": "",
        "metricName": "Flow speed",
        "unitOfMeasure": "A second",
        "value": "3000",
        "ruleViolation": [
          {
            "id": "38686a2a3b2682107222bf9985e45a4e",
            "description": "This speed is greater than the target",
            "name": "tooMuchTraffic",
            "numberOfAllowedCrossing": "0",
            "thresholdRuleSeverity": "high",
            "tolerancePeriod": "",
            "conformanceTargetLower": "2500",
            "conformanceComparatorLower": "greater than",
            "appliedConsequence": [
              {
                "id": "34686a2a3b2682107222bf9985e45a50",
                "appliedAction": "sendWarning",
                "description": "send a warning to the system",
                "name": "sendWarning",
                "repeatAction": "0"
              }
            ]
          }
        ]
      }
    ]
  }
]

Service Test Management Open API – GET /sn_sprb_mgmt/servicetestmanagement/serviceTest/{id}

Retrieves a service test entity based on the given ID of a service test.

URL format

Default URL: /api/sn_sprb_mgmt/servicetestmanagement/serviceTest/{id}

Supported request parameters

NameDescription
idSys\_id or external\_id of the service test to retrieve.Data type: String Table: Service Test \[sn\_st\_mgmt\_test\]
NameDescription
fieldsList of fields to return in the response. Invalid fields are ignored. If this parameter isn't used, all fields are returned. Located in the Service Test \[sn\_st\_mgmt\_test\] table.Valid fields: - characteristic - description - endDateTime - id - mode - relatedService - startDateTime - state - testMeasure - testSpecification - validFor Data type: String
NameDescription
None 

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

HeaderDescription
None 
HeaderDescription
Content-TypeData format of the response body. Only supports application/json.

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Status codeDescription
200Successful. The request was successfully processed.
400Bad Request. A bad request type or malformed request was detected.
404Not found. The requested item wasn't found.

Response body parameters (JSON or XML)

NameDescription
characteristicList that describes the characteristics of the associated service test.Data type: Array of Objects
"characteristic": [
 {
  "id": "String",
  "name": "String",
  "value": "String",
  "valueType": "String"
 }
]
characteristic.idSys\_id or external\_id of characteristics.If external\_id is present for that record, the response returns the external\_id otherwise it returns the sys\_id.Data type: String Table: Characteristics \[sn\_prd\_pm\_characteristic\]
characteristic.nameName of the characteristic.Data type: String
characteristic.valueCharacteristic options associated with the service test. Characteristics vary based on the customer instance.Data type: String
characteristic.valueTypeType of characteristic value.- choice - date - date/time - duration - email - label - single line test - yes/no Data type: String
descriptionDescription of the service test.Data type: String
endDateTimeEnd date and time of the service test.Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
hrefHyperlink reference to the service test.Data type: String
idSys\_id or external\_id of the service test definition.Data type: String Table: Service Test \[sn\_st\_mgmt\_test\]
modeMode that the service test is running in.Valid values: - ONDEMAND: Triggers the service test manually. - PROACTIVE: Triggers the service test automatically. Data type: String Default: ONDEMAND
nameName of the service test.Data type: String
relatedServiceTest definition associated with this test.Data type: Object
"relatedService": {
 "href": "String",
 "id": "String",
 "name": "String"
}
relatedService.idSys\_id or external\_id of the product inventory.Data type: String Table: In the sys\_id or external\_id field of the Product Inventory \[sn\_prd\_invt\_product\_inventory\] table.
relatedService.nameName of the product inventory item.Data type: String
startDateTimeStart date and time of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
stateState of the service test.Valid values: - acknowledged - canceled - completed - failed - inProgress - pending - rejected Data type: String
testMeasureMeasure of a specific aspect of a product, service, or resource test, such as lost packets or connectivity status.Data type: Array of Objects
"testMeasureDefinition": [
 {
  "accuracy": "String",
  "captureDateTime": "String",
  "captureMethod": "String",
  "id": "String",
  "metricDescription": "String",
  "metricName": "String",
  "ruleViolation": [Array]
  "unitOfMeasure": "String",
  "value": {Object}
 }
]
testMeasure.accuracyFloat decimal value representing the test measure accuracy captured for the associated metrics.Data type: Number Maximum value: 40
testMeasure.captureDateTimeThe date and time that the metric was captured.Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
testMeasure.captureMethodMethod used to capture the metric.Valid values: - automatic: Automatically capture the metric. - manual: Manually capture the metric. - none: Don't capture the metric. Data type: String
testMeasure.idSys\_id or external\_id of the test measure.Data type: String Table: Test Measures \[sn\_st\_mgmt\_test\_measure\]
testMeasure.metricDescriptionBrief description of the metric.Data type: String
testMeasure.metricNameName of a metric in the test measure.Data type: String
testMeasure.ruleViolationObject for defining a rule in the threshold rule definition, along with consequences if the rule is violated.Data type: Array of Objects
"RuleViolation": [
{
  "appliedConsequence": [Array],
  "conformanceComparatorExact": Boolean,
  "conformanceComparatorLower": "String",
  "conformanceComparatorUpper": "String",
  "conformanceTargetExact": "String",
  "conformanceTargetLower": "String",
  "conformanceTargetUpper": "String",
  "description": "String",
  "id": "String",
  "name": "String",
  "numberOfAllowedCrossing": Number,
  "thresholdRuleSeverity": "String",
  "tolerancePeriod": {Object}
 }
]
testMeasure.ruleViolation.appliedConsequenceAction \(prescribed action or notification\) to take when a threshold rule is violated.Data type: Array of Objects
"appliedConsequence": [
 {
  "appliedAction": "String",
  "description": "String",
  "id": "String",
  "name": "String",
  "repeatAction": Boolean
 }
]
testMeasure.ruleViolation.appliedConsequence.appliedActionAction to take when a threshold rule is violated. For example, sending a warning or generating a report. Applied actions can vary between instances.Data type: String
testMeasure.ruleViolation.appliedConsequence.appliedAction.repeatActionFlag that indicates whether to repeat the applied action or not.Valid values: - true: Repeats the action. - false: Doesn't repeat the action. Data type: Boolean Default: false
testMeasure.ruleViolation.appliedConsequence.descriptionDescription of the applied consequence.Data type: String
testMeasure.ruleViolation.appliedConsequence.idSys\_id or external\_id of the applied consequence.Data type: String
testMeasure.ruleViolation.appliedConsequence.nameName of the applied consequence.Data type: String
testMeasure.ruleViolation.conformanceComparatorExact

Flag that indicates whether a value is identical to the value of conformanceTargetExact.Valid values:

  • true: The value is identical.
  • false: The value isn't identical.

Data type: Boolean

Default: false

testMeasure.ruleViolation.conformanceComparatorLowerAn operator that checks if a value falls below the threshold. Valid values: - greater than - is Data type: String
testMeasure.ruleViolation.conformanceComparatorUpperAn operator that checks if a value exceeds the threshold.Valid values: - is - lesser than Data type: String
testMeasure.ruleViolation.conformanceTargetExactRequired if conformanceComparatorExact is set to true. If the conformanceComparatorExact value is set to true, its value matches the value defined in conformanceTargetExact.Data type: Number
testMeasure.ruleViolation.conformanceTargetLowerLower threshold value for comparing the test measure results. Determines if the threshold is crossed or no longer crossed.Data type: Number
testMeasure.ruleViolation.conformanceTargetUpperUpper threshold value for comparing the test measure results. Determines if the threshold is crossed or no longer crossed.Data type: Number
testMeasure.ruleViolation.descriptionDescription of the threshold rule violation.Data type: String
testMeasure.ruleViolation.idSys\_id or external\_id of the threshold rule violation.Data type: String Table: Threshold Rule Violation \[sn\_st\_mgmt\_threshold\_rule\_violation\]
testMeasure.ruleViolation.nameName of the threshold rule violation.Date type: String
testMeasure.ruleViolation.numberOfAllowedCrossingMaximum crossings allowed within the tolerance period before consequences are applied.Data type: Number Maximum: 40
testMeasure.ruleViolation.thresholdRuleSeveritySeverity of the threshold rule.Valid values: - high - low - medium Data type: String
testMeasure.ruleViolation.tolerancePeriodDuration or time interval in which allowed crossings can occur before a consequence is initiated.Date type: Object
"tolerancePeriod": {
 "amount": Number,
 "units": "String"
}
testMeasure.ruleViolation.tolerancePeriod.amountAmount of the period in number.Data type: Number
testMeasure.ruleViolation.tolerancePeriod.unitsUnits of the period.Valid values: - days - hours - minutes - seconds Data type: String
testMeasure.unitOfMeasureMeasurable value of time used to calculate the performance of a service in days, minutes, and seconds.Data type: String
testMeasure.valueValue of metric in the test.Data type: Object
"value": {
  "id": "String",
  "name": "String",
  "valueType": "String",
  "value": "String"
}
testMeasure.value.idID of the metric value in the test.Data type: String
testMeasure.value.nameName of the metric value in the test.Data type: String
testMeasure.value.valueValue of metric in the test.Data type: String
testMeasure.value.valueTypeType of test measure value such as numeric, text, and so forth.Data type: String
testSpecificationTest definition associated for this test. Data type: Object
"testSpecification": {
 "href": "String",
 "id": "String"
}
testSpecification.hrefHyperlink reference to the service test definition.Data type: String
testSpecification.idSys\_id or external\_id of the service test definition.Data type: String Table: Service Test Definition \[sn\_st\_mgmt\_test\_definition\]
validForDate range that the service test is valid for.Data type: Object
"validFor": {
  "endDateTime": "String",
  "startDateTime": "String"
}
validFor.endDateTimeEnd date and timestamp of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
validFor.startDateTimeStart date and timestamp of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.

cURL request

The following example retrieves details about the service test entity associated with the given ID, 44b7a8ea3b6a42107222bf9985e45a45.

curl --location --request GET “https://instance.servicenow.com/api/sn_sprb_mgmt/servicetestmanagement/serviceTest/44b7a8ea3b6a42107222bf9985e45a45 \
--user 'username’: ‘password'

Response body.

{
  "href": "/api/sn_sprb_mgmt/servicetestmanagement/serviceTest/44b7a8ea3b6a42107222bf9985e45a45",
  "id": "44b7a8ea3b6a42107222bf9985e45a45",
  "description": "Service test",
  "endDateTime": "2025-01-31 15:05:43",
  "mode": "proactive",
  "name": "Speed Test TR0001001",
  "startDateTime": "2024-06-05 08:22:52",
  "validFor": {
    "startDateTime": "",
    "endDateTime": ""
  },
  "relatedService": {
    "id": "fa6d13f45b5620102dff5e92dc81c77f",
    "name": "Internet_VPLS_PI0000011"
  },
  "testSpecification": {
    "href": "/api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/7d3854864316c6500e51203d5fb8f2d8",
    "id": "7d3854864316c6500e51203d5fb8f2d8"
  },
  "characteristic": [
        { 
        "id": "5c682a2a3b2682107222bf9985e45a5a", 
        "name": "url", 
        "valueType": "single_line_text", 
        "value": "test" 
         }
],
  "testMeasure": [
    {
      "id": "62ade42a3ba28210d140068aa4e45a71",
      "accuracy": "0.0001",
      "captureDateTime": "",
      "captureMethod": "automatic",
      "metricDescription": "",
      "metricName": "Downstream Speed",
      "unitOfMeasure": "",
      "value": "16",
      "ruleViolation": [
        {
          "id": "b9bee4ae3ba28210d140068aa4e45a3a",
          "description": "This speed is less than the target upper",
          "name": "tooMuchTraffic",
          "numberOfAllowedCrossing": "0",
          "thresholdRuleSeverity": "high",
          "tolerancePeriod": "",
          "conformanceTargetUpper": "75",
          "conformanceComparatorUpper": "less than",
          "appliedConsequence": [
            {
              "id": "489074aa3be28210d140068aa4e45a42",
              "appliedAction": "generateReport",
              "description": "",
              "name": "generateReport",
              "repeatAction": "0"
            },
            {
              "id": "785f2ce23be28210d140068aa4e45a75",
              "appliedAction": "sendWarning",
              "description": "",
              "name": "sendWarning",
              "repeatAction": "0"
            }
          ]
        }
      ]
    }
  ]
}

Service Test Management Open API - GET /sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification

Retrieves a list of all service test definitions.

URL format

Default URL: GET /api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification

Supported request parameters

NameDescription
None 
NameDescription
fieldsList of fields to return in the response. Invalid fields are ignored. If this parameter isn't used, all fields are returned. Located in the Service Test Definition \[sn\_st\_mgmt\_test\_definition\] table.Valid values: - description - id - name - relatedServiceSpecification - serviceTestSpecRelationship - specCharacteristic - testMeasureDefinition - validFor Data type: String
limit

Maximum number of records to return. For requests that exceed this number of records, use the offset parameter to paginate record retrieval.Data type: Number

Maximum value: 100

Default: 20

offsetStarting index at which to begin retrieving records. Use this parameter to paginate results in small and manageable chunks. The first record is indexed at 0.Data type: Number Default: 0
stateFilter test definitions by the test's current state. Only test definitions in the specified state are returned in the response.Valid values: - archived - draft - published - retired Data type: String
NameDescription
None 

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

HeaderDescription
AcceptData format of the response body. Supported types: application/json or application/xml. Default: application/json
HeaderDescription
Content-RangeSpecifies the range of content returned in a paginated call. For example, if `offset=2` and `limit=3`, the value of the Content-Range header is items `3-5`.
Content-TypeData format of the response body. Only supports application/json.
LinkContains the following links to navigate through query results:- first - last - next - previous
X-Total-CountFor paginated queries, this header specifies the total number of records available on the server.

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Status codeDescription
200Successful. The request was successfully processed.
206Partial resource returned in response (with pagination).
400Bad Request. A bad request type or malformed request was detected.
404Not found. The requested item wasn't found.

Response body parameters (JSON or XML)

NameDescription
descriptionDescription of the service test definition.Data type: String
idSys\_id or external\_id of the service test definition.Data type: String Table: Service Test Definition \[sn\_st\_mgmt\_test\_definition\]
nameRequired. Name of the service test definition.Data type: String
relatedServiceSpecificationRequired. Service specifications of the test definition.Data type: Array of Objects
"relatedServiceSpecification": [
  {
    "id": "String",
    "name": "String"
  }
]
relatedServiceSpecification.idSys\_id or external\_id of the service specification.Data type: String Table: In the sys\_id or external\_id field of the Specification \[sn\_prd\_pm\_specification\] table.
relatedServiceSpecification.nameName of the service specification.Data type: String
serviceTestSpecRelationshipRelated service test definition.Data type: Array of Objects
"serviceTestSpecRelationship": [
 {
  "id": "String",
  "name": "String",
  "relationshipType": "String"
 }
]
serviceTestSpecRelationship.idSys\_id or external\_id of the related service test definition.Data type: String Table: Test Definition \[sn\_st\_mgmt\_test\_definition\]
serviceTestSpecRelationship.nameName of the related test definition.Data type: String
serviceTestSpecRelationship.relationshipTypeType of relationship.Accepted values: - dependency - exclusivity - substitution Data type: String
specCharacteristicCharacteristics of the test definition.Data type: Array of Objects
"specCharacteristic": [
 {
  "characteristicValueSpecification": [Array],
  "description": "String",
  "name": "String",
  "validFor": {Object},
  "valueType": "String"
 }
]
specCharacteristic.characteristicValueSpecificationPossible values of the characteristic.Data type: Array of Objects
"characteristicValueSpecification": [
  {
    "value": "String"
  }
]
specCharacteristic.characteristicValueSpecification.valueValue of the characteristic.Data type: String
specCharacteristic.descriptionDescription of the characteristic.Data type: String
specCharacteristic.nameName of the characteristic.Data type: String
specCharacteristic.validForDate range that the characteristic is valid for.Data type: Object
"validFor": {
 "endDateTime": "String",
 "startDateTime": "String"
}
specCharacteristic.validFor.endDateTimeEnd date of the characteristic. Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. Data type: String
specCharacteristic.validFor.startDateTimeStart date of the characteristic. Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. Data type: String
specCharacteristic.valueTypeType of characteristic value.- choice - date - date/time - duration - email - label - single line test - yes/no Data type: String
testMeasureDefinitionTest measure definitions for this service test definition. For more information, see Define test measure definitions for a service test.Data type: Array of objects
"testMeasureDefinition": [
 {
  "captureFrequency": "String",
  "captureMethod": "String",
  "capturePeriod": {Object},
  "id": "String",
  "metricDescription": "String",
  "metricName": "String",
  "name": "String",
  "unitOfMeasure": "String",
  "thresholdRule": [Array],
  "validFor": {Object},
  "valueType": "String"
 }
]
testMeasureDefinition.captureFrequencyThe frequency at which to capture the metric. Valid values: - daily - monthly - none - once - weekly Data type: String
testMeasureDefinition.captureMethodMethod used to capture the metric.Valid values: - automatic: Automatically capture the metric. - manual: Manually capture the metric. - none: Doesn't capture the metric. Data type: String
testMeasureDefinition.capturePeriodPeriod or duration of the metric capture.Data type: Object
"capturePeriod": {
  "amount": Number,
  "units": "String"
}
testMeasureDefinition.capturePeriod.amountNumber of capture periods.Data type: Number
testMeasureDefinition.capturePeriod.unitsUnits of the period.Valid values: - days - hours - minutes - seconds Data type: String
testMeasureDefinition.idSys\_id or external\_id of the test measure definitions.Data type: String Table: Test Measure definition table \[sn\_st\_mgmt\_test\_measure\_definition\]
testMeasureDefinition.metricDescriptionBrief description of the metric.Data type: String
testMeasureDefinition.metricNameUser-defined name of a metric in the test measure.Data type: String
testMeasureDefinition.nameName of the test measure definition.Data type: String
testMeasureDefinition.thresholdRuleRule that defines conditions to achieve before applying consequences when a threshold is crossed \(or not crossed\)​ in the test measure definition. For more information, Define threshold rules for a test measure definition.Data type: Array of Objects
{
  "thresholdRule": {
    "consequence": [Array],
    "conformanceComparatorExact": Boolean,
    "conformanceComparatorLower": "String",
    "conformanceComparatorUpper": "String",
    "conformanceTargetExact": "String",
    "conformanceTargetLower": "String",
    "conformanceTargetUpper": "String",
    "consequence": [Array],
    "description": "String",
    "id": "String",
    "name": "String",
    "numberOfAllowedCrossing": Number,
    "thresholdRuleSeverity": "String",
    "tolerancePeriod": {Object}
  }
}
testMeasureDefinition.thresholdRule.conformanceComparatorExact

Flag that indicates whether a value is identical to the value set for testMeasureDefinition.thresholdRule.conformanceTargetExact. If set to true, testMeasureDefinition.thresholdRule.conformanceTargetExact is required.Valid values:

  • true: The value is identical to the value of conformanceTargetExact.
  • false: The value isn't identical conformanceTargetExact.

Data type: Boolean

Default: false

testMeasureDefinition.thresholdRule.conformanceComparatorLowerOperator that checks if a value falls below the threshold. Valid values: - greater than - greater than or is Data type: String
testMeasureDefinition.thresholdRule.conformanceComparatorUpperOperator that checks if a value exceeds the threshold.Valid values: - less than - less than or is Data type: String
testMeasureDefinition.thresholdRule.conformanceTargetExactRequired if conformanceComparatorExact is set to true. If the conformanceComparatorExact value is set to true, its value matches the value defined in conformanceTargetExact.Data type: Number
testMeasureDefinition.thresholdRule.conformanceTargetLowerLower threshold value for comparing the test measure results.Data type: Number
testMeasureDefinition.thresholdRule.conformanceTargetUpperUpper threshold value for comparing the test measure results.Data type: Number
testMeasureDefinition.thresholdRule.consequenceAction \(prescribed action or notification\) to take when a threshold rule is crossed. See Define threshold rules for a test measure definition for more information.Data type: Array of objects
"consequence": [
 {
  "description": "String",
  "id": "String",
  "name": "String",
  "prescribeAction": "String",
  "repeatAction": Boolean,
  "validFor": {
  "endDateTime": "String",
  "startDateTime": "String"
 }
]
testMeasureDefinition.thresholdRule.consequence.descriptionDescription of the consequence. Data type: String
testMeasureDefinition.thresholdRule.consequence.idSys\_id or external\_id of the measure consequence.Data type: String
testMeasureDefinition.thresholdRule.consequence.nameName of the consequence.Data type: String
testMeasureDefinition.thresholdRule.consequence.prescribeActionUser-defined action to take for threshold violations. Actions vary between instances.Data type: String
testMeasureDefinition.thresholdRule.consequence.repeatActionFlag that indicates whether to repeat the applied consequence.Valid values: - true: Repeats the action. - false: Doesn't repeat the action. Data type: Boolean Default: false
testMeasureDefinition.thresholdRule.consequence.validForDate range that the consequence is valid for.Data type: Object
"validFor": {
 "startDateTime": "String",
 "endDateTime ": "String"
}
testMeasureDefinition.thresholdRule.consequence.validFor.endDateTimeValidity end date of the consequence. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
testMeasureDefinition.thresholdRule.consequence.validFor.startDateTimeValidity start date of the consequence. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
testMeasureDefinition.thresholdRule.descriptionDescription of the threshold rule.Data type: String
testMeasureDefinition.thresholdRule.idSys\_id or external\_id of the threshold rules.Data type: String Table: In the sys\_id or external\_id field of the Threshold Rules \[sn\_st\_mgmt\_threshold\_rule\] table.
testMeasureDefinition.thresholdRule.nameName of the threshold rule.Data type: String
testMeasureDefinition.thresholdRule.numberOfAllowedCrossingMaximum crossings allowed within the tolerance period before consequences are applied.Data type: Number Maximum value: 40
testMeasureDefinition.thresholdRule.thresholdRuleSeveritySeverity level of the threshold rule.Valid values: - high - medium - low Data type: String
testMeasureDefinition.unitOfMeasureMeasurable value of time used to calculate the performance of a service in days, minutes, and seconds.Data type: String
testMeasureDefinition.validForDate range that the test measure definition is valid for.Data type: String
"validFor": {
 "endDateTime": "String",
 "startDateTime": "String"
}
testMeasureDefinition.validFor.endDateTimeValidity end date of the test measure definition. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
testMeasureDefinition.validFor.startDateTimeValidity start date of the test measure definition. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
validForDate range that the test definition is valid for.Data type: Object
"validFor": {
 "endDateTime": "String",
 "startDateTime": "String"
}
validFor.endDateTimeDate and time of the test definition on which the state of it is retired. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
validFor.startDateTimeDate and time of the test definition on which the state of it is published. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.

cURL request

This example retrieves details about all test service test definitions in the instance. In this case, two definitions are returned.

curl --location --request GET 
“https://instance.servicenow.com//api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification” \
--user 'username’: ‘password'

Response body.

[
  {
    "description": "Operation, Administration and Maintenance",
    "id": "76a3b160432a02104fefe4511fb8f2ad",
    "name": "OAM Test",
    "validFor": {
      "startDateTime": "",
      "endDateTime": ""
    },
    "testMeasureDefinition": [
      {
        "id": "77b9b964432a02104fefe4511fb8f26e",
        "captureFrequency": "once",
        "captureMethod": "automatic",
        "metricDescription": "This is the Rx signal level",
        "metricName": "Rx Optical Signal Level",
        "name": "Rx Optical Signal Level",
        "unitOfMeasure": "a minute",
        "valueType": "",
        "capturePeriod": "",
        "validFor": {
          "startDateTime": "",
          "endDateTime": ""
        },
        "thresholdRule": [
          {
            "id": "d3e97d64432a02104fefe4511fb8f281",
            "description": "",
            "name": "gponOntAniOpInfoRxOpticalSignalLevel",
            "numberOfAllowedCrossing": "",
            "thresholdRuleSeverity": "",
            "tolerancePeriod": "",
            "conformanceTargetUpper": "0",
            "conformanceComparatorUpper": "less than",
            "conformanceTargetLower": "-50",
            "conformanceComparatorLower": "greater than",
            "consequence": []
          }
        ]
      },
      {
        "id": "878afd64432a02104fefe4511fb8f28d",
        "captureFrequency": "once",
        "captureMethod": "automatic",
        "metricDescription": "This is the Tx signal level",
        "metricName": "TX Optical Signal Level",
        "name": "TX Optical Signal Level",
        "unitOfMeasure": "a minute",
        "valueType": "",
        "capturePeriod": "",
        "validFor": {
          "startDateTime": "",
          "endDateTime": ""
        },
        "thresholdRule": [
          {
            "id": "b3dab5a4432a02104fefe4511fb8f2d3",
            "description": "",
            "name": "gponOntAniOpInfoTxOpticalSignalLevel",
            "numberOfAllowedCrossing": "",
            "thresholdRuleSeverity": "",
            "tolerancePeriod": "",
            "conformanceTargetUpper": "65",
            "conformanceComparatorUpper": "less than",
            "conformanceTargetLower": "-65",
            "conformanceComparatorLower": "greater than",
            "consequence": []
          }
        ]
      }
    ],
    "specCharacteristic": [
      {
        "name": "AccessRequired",
        "description": "AccessRequired",
        "valueType": "yes_no",
        "validFor": {
          "startDatetime": "2024-05-30 09:09:57"
        },
        "characteristicValueSpecification": [
          {
            "value": "Yes",
            "validFor": {
              "startDateTime": "",
              "endDateTime": ""
            }
          },
          {
            "value": "No",
            "validFor": {
              "startDateTime": "",
              "endDateTime": ""
            }
          }
        ]
      }
    ],
    "serviceTestSpecRelationship": [],
    "relatedServiceSpecification": [
      {
        "id": "f559b564432a02104fefe4511fb8f2e0",
        "name": "OAM"
      }
    ]
  },
  {
    "description": "Upstream and Downstream speed ",
    "id": "89d2b920432a02104fefe4511fb8f22e",
    "name": "Speed Test",
    "validFor": {
      "startDateTime": "2024-05-31",
      "endDateTime": "2024-06-27"
    },
    "testMeasureDefinition": [
      {
        "id": "1a04f560432a02104fefe4511fb8f2ad",
        "captureFrequency": "once",
        "captureMethod": "automatic",
        "metricDescription": "This is the downstream speed in a service",
        "metricName": "Downstream Speed",
        "name": "Downstream Speed",
        "unitOfMeasure": "a second",
        "valueType": "",
        "capturePeriod": "30 Minutes",
        "validFor": {
          "startDateTime": "2024-05-30 08:49:26",
          "endDateTime": "2024-05-31 08:49:29"
        },
        "thresholdRule": [
          {
            "id": "a754f960432a02104fefe4511fb8f2d0",
            "description": "This speed is greater than the target upper",
            "name": "InternetSpeedValue",
            "numberOfAllowedCrossing": "0",
            "thresholdRuleSeverity": "high",
            "tolerancePeriod": "15 Minutes",
            "conformanceTargetLower": "75",
            "conformanceComparatorLower": "greater than",
            "consequence": [
              {
                "id": "15a4bd60432a02104fefe4511fb8f2b8",
                "prescribeAction": "null",
                "description": "generate a waring report",
                "name": "degradedQualityOfService",
                "repeatAction": "0",
                "validFor": {
                  "startDateTime": "2024-05-30 08:51:29",
                  "endDateTime": "2024-08-06 08:51:31"
                }
              },
              {
                "id": "e6847d60432a02104fefe4511fb8f2c3",
                "prescribeAction": "null",
                "description": "send a warning to the system",
                "name": "packetdrop",
                "repeatAction": "0",
                "validFor": {
                  "startDateTime": "2024-05-30 08:50:53",
                  "endDateTime": "2024-08-06 08:50:55"
                }
              }
            ]
          },
          {
            "id": "cb55b5a0432a02104fefe4511fb8f201",
            "description": "",
            "name": "InternetSpeedValue",
            "numberOfAllowedCrossing": "0",
            "thresholdRuleSeverity": "medium",
            "tolerancePeriod": "",
            "conformanceTargetUpper": "120",
            "conformanceComparatorUpper": "less than",
            "consequence": []
          }
        ]
      },
      {
        "id": "8f987524432a02104fefe4511fb8f2f0",
        "captureFrequency": "once",
        "captureMethod": "automatic",
        "metricDescription": "This is the upstream speed in the service",
        "metricName": "Upstream Speed",
        "name": "Upstream Speed",
        "unitOfMeasure": "a second",
        "valueType": "",
        "capturePeriod": "",
        "validFor": {
          "startDateTime": "",
          "endDateTime": ""
        },
        "thresholdRule": []
      }
    ],
    "specCharacteristic": [
      {
        "name": "restart",
        "description": "restart",
        "valueType": "yes_no",
        "validFor": {
          "startDatetime": "2024-05-30 08:45:49"
        },
        "characteristicValueSpecification": [
          {
            "value": "No",
            "validFor": {
              "startDateTime": "",
              "endDateTime": ""
            }
          },
          {
            "value": "Yes",
            "validFor": {
              "startDateTime": "",
              "endDateTime": ""
            }
          }
        ]
      }
    ],
    "serviceTestSpecRelationship": [
      {
        "id": "76a3b160432a02104fefe4511fb8f2ad",
        "name": "OAM Test",
        "relationshipType": ""
      }
    ],
    "relatedServiceSpecification": [
      {
        "id": "aeddcd1fb7d69910ff00f203ae11a990",
        "name": "Home Internet"
      }
    ]
  }
]

Service Test Management Open API - GET /sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/{id}

Retrieves a service test definition entity.

URL format

Default URL: /api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/{id}

Supported request parameters

NameDescription
idSys\_id or external\_id of the service test definition to retrieve.Data type: String Table: Service Test Definition \[sn\_st\_mgmt\_test\_definition\]
NameDescription
fieldsList of fields to return in the response. Invalid fields are ignored. If this parameter isn't used, all fields are returned. Located in the Service Test Definition \[sn\_st\_mgmt\_test\_definition\] table.Valid values: - description - id - name - relatedServiceSpecification - serviceTestSpecRelationship - specCharacteristic - testMeasureDefinition - validFor Data type: String
stateFilter test definitions by the test's current state. Only test definitions in the specified state are returned in the response.Valid values: - archived - draft - published - retired Data type: String
NameDescription
None 

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

HeaderDescription
AcceptData format of the response body. Supported types: application/json or application/xml. Default: application/json
HeaderDescription
Content-TypeData format of the request body. Only supports application/json.

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Status codeDescription
200Successful. The request was successfully processed.
400Bad Request. A bad request type or malformed request was detected.
404Not found. The requested item wasn't found.

Response body parameters (JSON or XML)

NameDescription
descriptionDescription of the service test definition.Data type: String
idSys\_id or external\_id of the service test definition.Data type: String Table: Service Test Definition \[sn\_st\_mgmt\_test\_definition\]
nameRequired. Name of the service test definition.Data type: String
relatedServiceSpecificationRequired. Service specifications of the test definition.Data type: Array of Objects
"relatedServiceSpecification": [
  {
    "id": "String",
    "name": "String"
  }
]
relatedServiceSpecification.idSys\_id or external\_id of the service specification.Data type: String Table: In the sys\_id or external\_id field of the Specification \[sn\_prd\_pm\_specification\] table.
relatedServiceSpecification.nameName of the service specification.Data type: String
serviceTestSpecRelationshipRelated service test definition.Data type: Array of Objects
"serviceTestSpecRelationship": [
 {
  "id": "String",
  "name": "String",
  "relationshipType": "String"
 }
]
serviceTestSpecRelationship.idSys\_id or external\_id of the related service test definition.Data type: String Table: Test Definition \[sn\_st\_mgmt\_test\_definition\]
serviceTestSpecRelationship.nameName of the related test definition.Data type: String
serviceTestSpecRelationship.relationshipTypeType of relationship.Accepted values: - dependency - exclusivity - substitution Data type: String
specCharacteristicCharacteristics of the test definition.Data type: Array of Objects
"specCharacteristic": [
 {
  "characteristicValueSpecification": [Array],
  "description": "String",
  "name": "String",
  "validFor": {Object},
  "valueType": "String"
 }
]
specCharacteristic.characteristicValueSpecificationPossible values of the characteristic.Data type: Array of Objects
"characteristicValueSpecification": [
  {
    "value": "String"
  }
]
specCharacteristic.characteristicValueSpecification.valueValue of the characteristic.Data type: String
specCharacteristic.descriptionDescription of the characteristic.Data type: String
specCharacteristic.nameName of the characteristic.Data type: String
specCharacteristic.validForDate range that the characteristic is valid for.Data type: Object
"validFor": {
 "endDateTime": "String",
 "startDateTime": "String"
}
specCharacteristic.validFor.endDateTimeEnd date of the characteristic. Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. Data type: String
specCharacteristic.validFor.startDateTimeStart date of the characteristic. Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. Data type: String
specCharacteristic.valueTypeType of characteristic value.- choice - date - date/time - duration - email - label - single line test - yes/no Data type: String
testMeasureDefinitionTest measure definitions for this service test definition. For more information, see Define test measure definitions for a service test.Data type: Array of objects
"testMeasureDefinition": [
 {
  "captureFrequency": "String",
  "captureMethod": "String",
  "capturePeriod": {Object},
  "id": "String",
  "metricDescription": "String",
  "metricName": "String",
  "name": "String",
  "unitOfMeasure": "String",
  "thresholdRule": [Array],
  "validFor": {Object},
  "valueType": "String"
 }
]
testMeasureDefinition.captureFrequencyThe frequency at which to capture the metric. Valid values: - daily - monthly - none - once - weekly Data type: String
testMeasureDefinition.captureMethodMethod used to capture the metric.Valid values: - automatic: Automatically capture the metric. - manual: Manually capture the metric. - none: Doesn't capture the metric. Data type: String
testMeasureDefinition.capturePeriodPeriod or duration of the metric capture.Data type: Object
"capturePeriod": {
  "amount": Number,
  "units": "String"
}
testMeasureDefinition.capturePeriod.amountNumber of capture periods.Data type: Number
testMeasureDefinition.capturePeriod.unitsUnits of the period.Valid values: - days - hours - minutes - seconds Data type: String
testMeasureDefinition.idSys\_id or external\_id of the test measure definitions.Data type: String Table: Test Measure definition table \[sn\_st\_mgmt\_test\_measure\_definition\]
testMeasureDefinition.metricDescriptionBrief description of the metric.Data type: String
testMeasureDefinition.metricNameUser-defined name of a metric in the test measure.Data type: String
testMeasureDefinition.nameName of the test measure definition.Data type: String
testMeasureDefinition.thresholdRuleRule that defines conditions to achieve before applying consequences when a threshold is crossed \(or not crossed\)​ in the test measure definition. For more information, Define threshold rules for a test measure definition.Data type: Array of Objects
{
  "thresholdRule": {
    "consequence": [Array],
    "conformanceComparatorExact": Boolean,
    "conformanceComparatorLower": "String",
    "conformanceComparatorUpper": "String",
    "conformanceTargetExact": "String",
    "conformanceTargetLower": "String",
    "conformanceTargetUpper": "String",
    "consequence": [Array],
    "description": "String",
    "id": "String",
    "name": "String",
    "numberOfAllowedCrossing": Number,
    "thresholdRuleSeverity": "String",
    "tolerancePeriod": {Object}
  }
}
testMeasureDefinition.thresholdRule.conformanceComparatorExact

Flag that indicates whether a value is identical to the value set for testMeasureDefinition.thresholdRule.conformanceTargetExact. If set to true, testMeasureDefinition.thresholdRule.conformanceTargetExact is required.Valid values:

  • true: The value is identical to the value of conformanceTargetExact.
  • false: The value isn't identical conformanceTargetExact.

Data type: Boolean

Default: false

testMeasureDefinition.thresholdRule.conformanceComparatorLowerOperator that checks if a value falls below the threshold. Valid values: - greater than - greater than or is Data type: String
testMeasureDefinition.thresholdRule.conformanceComparatorUpperOperator that checks if a value exceeds the threshold.Valid values: - less than - less than or is Data type: String
testMeasureDefinition.thresholdRule.conformanceTargetExactRequired if conformanceComparatorExact is set to true. If the conformanceComparatorExact value is set to true, its value matches the value defined in conformanceTargetExact.Data type: Number
testMeasureDefinition.thresholdRule.conformanceTargetLowerLower threshold value for comparing the test measure results.Data type: Number
testMeasureDefinition.thresholdRule.conformanceTargetUpperUpper threshold value for comparing the test measure results.Data type: Number
testMeasureDefinition.thresholdRule.consequenceAction \(prescribed action or notification\) to take when a threshold rule is crossed. See Define threshold rules for a test measure definition for more information.Data type: Array of objects
"consequence": [
 {
  "description": "String",
  "id": "String",
  "name": "String",
  "prescribeAction": "String",
  "repeatAction": Boolean,
  "validFor": {
  "endDateTime": "String",
  "startDateTime": "String"
 }
]
testMeasureDefinition.thresholdRule.consequence.descriptionDescription of the consequence. Data type: String
testMeasureDefinition.thresholdRule.consequence.idSys\_id or external\_id of the measure consequence.Data type: String
testMeasureDefinition.thresholdRule.consequence.nameName of the consequence.Data type: String
testMeasureDefinition.thresholdRule.consequence.prescribeActionUser-defined action to take for threshold violations. Actions vary between instances.Data type: String
testMeasureDefinition.thresholdRule.consequence.repeatActionFlag that indicates whether to repeat the applied consequence.Valid values: - true: Repeats the action. - false: Doesn't repeat the action. Data type: Boolean Default: false
testMeasureDefinition.thresholdRule.consequence.validForDate range that the consequence is valid for.Data type: Object
"validFor": {
 "startDateTime": "String",
 "endDateTime ": "String"
}
testMeasureDefinition.thresholdRule.consequence.validFor.endDateTimeValidity end date of the consequence. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
testMeasureDefinition.thresholdRule.consequence.validFor.startDateTimeValidity start date of the consequence. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
testMeasureDefinition.thresholdRule.descriptionDescription of the threshold rule.Data type: String
testMeasureDefinition.thresholdRule.idSys\_id or external\_id of the threshold rules.Data type: String Table: In the sys\_id or external\_id field of the Threshold Rules \[sn\_st\_mgmt\_threshold\_rule\] table.
testMeasureDefinition.thresholdRule.nameName of the threshold rule.Data type: String
testMeasureDefinition.thresholdRule.numberOfAllowedCrossingMaximum crossings allowed within the tolerance period before consequences are applied.Data type: Number Maximum value: 40
testMeasureDefinition.thresholdRule.thresholdRuleSeveritySeverity level of the threshold rule.Valid values: - high - medium - low Data type: String
testMeasureDefinition.unitOfMeasureMeasurable value of time used to calculate the performance of a service in days, minutes, and seconds.Data type: String
testMeasureDefinition.validForDate range that the test measure definition is valid for.Data type: String
"validFor": {
 "endDateTime": "String",
 "startDateTime": "String"
}
testMeasureDefinition.validFor.endDateTimeValidity end date of the test measure definition. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
testMeasureDefinition.validFor.startDateTimeValidity start date of the test measure definition. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
validForDate range that the test definition is valid for.Data type: Object
"validFor": {
 "endDateTime": "String",
 "startDateTime": "String"
}
validFor.endDateTimeDate and time of the test definition on which the state of it is retired. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
validFor.startDateTimeDate and time of the test definition on which the state of it is published. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.

cURL request

This example retrieves details of a service test definition with a given ID.

curl --location --request GET "https:/instance.servicenow.com/api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/89d2b920432a02104fefe4511fb8f22e" \
--user 'username’: ‘password'

Response body.

{
  "description": "Upstream and Downstream speed ",
  "id": "89d2b920432a02104fefe4511fb8f22e",
  "name": "Speed Test",
  "validFor": {
    "startDateTime": "2024-05-31",
    "endDateTime": "2024-06-27"
  },
  "testMeasureDefinition": [
    {
      "id": "1a04f560432a02104fefe4511fb8f2ad",
      "captureFrequency": "once",
      "captureMethod": "automatic",
      "metricDescription": "This is the downstream speed in a service",
      "metricName": "Downstream Speed",
      "name": "Downstream Speed",
      "unitOfMeasure": "a second",
      "valueType": "",
      "capturePeriod": "30 Minutes",
      "validFor": {
        "startDateTime": "2024-05-30 08:49:26",
        "endDateTime": "2024-05-31 08:49:29"
      },
      "thresholdRule": [
        {
          "id": "a754f960432a02104fefe4511fb8f2d0",
          "description": "This speed is greater than the target upper",
          "name": "InternetSpeedValue",
          "numberOfAllowedCrossing": "0",
          "thresholdRuleSeverity": "high",
          "tolerancePeriod": "15 Minutes",
          "conformanceTargetLower": "75",
          "conformanceComparatorLower": "greater than",
          "consequence": [
            {
              "id": "15a4bd60432a02104fefe4511fb8f2b8",
              "prescribeAction": "null",
              "description": "generate a waring report",
              "name": "degradedQualityOfService",
              "repeatAction": "0",
              "validFor": {
                "startDateTime": "2024-05-30 08:51:29",
                "endDateTime": "2024-08-06 08:51:31"
              }
            },
            {
              "id": "e6847d60432a02104fefe4511fb8f2c3",
              "prescribeAction": "null",
              "description": "send a warning to the system",
              "name": "packetdrop",
              "repeatAction": "0",
              "validFor": {
                "startDateTime": "2024-05-30 08:50:53",
                "endDateTime": "2024-08-06 08:50:55"
              }
            }
          ]
        },
        {
          "id": "cb55b5a0432a02104fefe4511fb8f201",
          "description": "",
          "name": "InternetSpeedValue",
          "numberOfAllowedCrossing": "0",
          "thresholdRuleSeverity": "medium",
          "tolerancePeriod": "",
          "conformanceTargetUpper": "120",
          "conformanceComparatorUpper": "less than",
          "consequence": []
        }
      ]
    }
  ],
  "specCharacteristic": [
    {
      "name": "restart",
      "description": "restart",
      "valueType": "yes_no",
      "validFor": {
        "startDatetime": "2024-05-30 08:45:49"
      },
      "characteristicValueSpecification": [
        {
          "value": "No",
          "validFor": {
            "startDateTime": "",
            "endDateTime": ""
          }
        },
        {
          "value": "Yes",
          "validFor": {
            "startDateTime": "",
            "endDateTime": ""
          }
        }
      ]
    }
  ],
  "serviceTestSpecRelationship": [
    {
      "id": "76a3b160432a02104fefe4511fb8f2ad",
      "name": "OAM Test",
      "relationshipType": ""
    }
  ],
  "relatedServiceSpecification": [
    {
      "id": "aeddcd1fb7d69910ff00f203ae11a990",
      "name": "Home Internet"
    }
  ]
}

Service Test Management Open API - PATCH /sn_sprb_mgmt/servicetestmanagement/serviceTest/{id}

Updates a service test entity.

URL format

Default URL: /api/sn_sprb_mgmt/servicetestmanagement/serviceTest/{id}

Supported request parameters

NameDescription
idSys\_id or external\_id of the service test to retrieve.Data type: String Table: Service Test \[sn\_st\_mgmt\_test\]
NameDescription
None 
NameDescription
characteristicList that describes the characteristics of the associated service test. For more information about test definition characteristics, see Data type: Array of Objects
"characteristic": [
 {
  "id": "String",
  "name": "String",
  "value": "String",
  "valueType": "String"
 }
]
characteristic.idSys\_id or external\_id of characteristics. If external\_id is present for that record, the response returns the external\_id otherwise it returns the sys\_id.Data type: String Table: Characteristics \[sn\_prd\_pm\_characteristic\]
characteristic.nameName of the characteristic.Data type: String
characteristic.valueCharacteristic options associated with the service test. Characteristics vary based on the customer instance.Data type: String
characteristic.valueTypeType of characteristic value.- choice - date - date/time - duration - email - label - single line test - yes/no Data type: String
descriptionDescription of the service test.Data type: String
endDateTimeEnd date and time of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
modeMode that the service test is running in.Valid values: - ONDEMAND: Triggers the service test manually. - PROACTIVE: Triggers the service test automatically. Data type: String Default: ONDEMAND
nameRequired. Name of the service test.Data type: String
relatedServiceRequired. Test definition associated with the service test.Data type: Object
"relatedService": {
 "href": "String",
 "id": "String",
 "name": "String"
}
relatedService.hrefHyperlink reference to the related service.Data type: String
relatedService.idSys\_id or external\_id of the product inventory.Data type: String Table: In the sys\_id or external\_id field of the product Inventory \[sn\_prd\_invt\_product\_inventory\] table.
startDateTimeStart date and time of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
stateState the service test is in. Valid values: - acknowledged - canceled - completed - failed - inProgress - pending - rejected Data type: String
testMeasureMeasure of a specific aspect of a product, service, or resource test, such as lost packets or connectivity status.Data type: Array of Objects
"testMeasure": [
 {
 "accuracy": "String",
 "captureDateTime": "String",
 "captureMethod": "String",
 "id": "String",
 "metricDescription": "String",
 "metricName": "String",
 "ruleViolation": [Array],
 "unitOfMeasure": "String",
 "value": {Object}
 }
]
testMeasure.accuracyFloat decimal value representing the test measure accuracy captured for the associated metrics.Data type: Number Maximum value: 40
testMeasure.captureDateTimeThe date and time that the metric was captured. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
testMeasure.idSys\_id or external\_id of the Test Measures.Data type: String Table: In the sys\_id or external\_id fields of the Test Measures table \[sn\_st\_mgmt\_test\_measure\] table.
testMeasure.Measure.captureMethodMethod used to capture the metric.Valid values: - automatic: Automatically capture the metric. - manual: Manually capture the metric. - none: Don't capture the metric. Data type: String
testMeasure.metricDescriptionBrief description of the metric.Data type: String
testMeasure.metricNameName of the test measure metric.Data type: String
testMeasure.ruleViolationAn object for defining a rule in the threshold rule definition, along with consequences if the rule is violated.Data type: Array of Objects
"ruleViolation"[
  {
    appliedConsequence: [Array],
    conformanceTargetUpper: Number,
    conformanceComparatorUpper: "String",
    description: "String",
    id: "String",
    name: "String",
    numberOfAllowedCrossing: Number,
    thresholdRuleSeverity: "String",
    tolerancePeriod: "String"
  }
]
testMeasure.ruleViolation.tolerancePeriod.amountNumber of periods before applying the consequence.Data type: Number
testMeasure.ruleViolation.appliedConsequenceAction \(prescribed action or notification\) to take when a threshold rule is crossed.Data type: Array of Objects
"appliedConsequence": [
 {
  "appliedAction": "String",
  "description": "String",
  "id": "String",
  "name": "String",
  "repeatAction": Boolean
 }
]
testMeasure.ruleViolation.appliedConsequence.appliedActionAction to take when a threshold rule is violated. For example, sending a warning or generating a report. Applied actions can vary between instances.Data type: String
testMeasure.ruleViolation.appliedConsequence.descriptionDescription of the applied consequence.Data type: String
testMeasure.ruleViolation.appliedConsequence.idSys\_id or external\_id of the applied consequence.Data type: String
testMeasure.ruleViolation.appliedConsequence.nameName of the applied consequence.Data type: String
testMeasure.ruleViolation.appliedConsequence.repeatActionFlag that indicates whether to repeat the consequence when a second violation occurs.Valid values: - true: Repeat the action. - false: Don't repeat the action. Data type: Boolean Default: false
testMeasure.ruleViolation.conformanceComporatorExactFlag that indicates whether a value is identical.Valid values: - true: The value is identical. - false: The value isn't identical. Data type: Boolean Default: false
testMeasure.ruleViolation.conformanceComporatorLowerOperator for checking if a value falls below the threshold.Valid values: - greater than - greater than or is Data type: String
testMeasure.ruleViolation.conformanceComporatorUpperOperator for checking if a value is above the threshold.Valid values: - less than - less than or is Data type: String
testMeasure.ruleViolation.conformanceTargetExactRequired if conformanceComparatorExact is set to true. If the conformanceComparatorExact value is set to true, its value matches the value defined in conformanceTargetExact.Data type: Number
testMeasure.ruleViolation.conformanceTargetLowerLower threshold value for comparing the test measure results. Determines if the threshold is crossed or no longer crossed.Data type: Number
testMeasure.ruleViolation.conformanceTargetUpperUpper threshold value for comparing the test measure results. Determines if the threshold is crossed or no longer crossed.Data type: Number
testMeasure.ruleViolation.descriptionDescription of the threshold rule.Data type: String
testMeasure.ruleViolation.idSys\_id or external\_id of the threshold rule violation.Data type: String Table: Threshold Rule Violation \[sn\_st\_mgmt\_threshold\_rule\_violation\]
testMeasure.ruleViolation.nameName of the threshold rule.Data type: String
testMeasure.ruleViolation.numberOfAllowedCrossingMaximum crossings allowed within the tolerance period before consequences are applied.Data type: Number Maximum value: 40
testMeasure.ruleViolation.thresholdRuleSeveritySeverity of the threshold rule.Valid values: - high - medium - low Data type: String
testMeasure.ruleViolation.tolerancePeriodSpecified time interval during which crossing occurrences are enabled without triggering any immediate consequences or actions.Date type: Object
"tolerancePeriod": {
 "amount": Number,
 "units": "String"
}
testMeasure.ruleViolation.tolerancePeriod.unitsUnits of the period.Valid values: - days - hours - minutes - seconds Data type: String
testMeasure.unitOfMeasureUnit of measurement for the conformance target values of the test measure.Data type: String
testMeasure.valueValue of the test measure.Data type: Object
"value": {
 "id": "String",
 "name": "String",
 "valueType": "String",
 "value": "String
}
testMeasure.value.idID of the test measure value.Data type: String
testMeasure.value.nameName of the test measure value.Data type: String
testMeasure.value.valueValue of the test measure.Data type: String
testMeasure.value.valueTypeType of test measure value such as numeric, text, and so forth.Data type: String
testSpecificationRequired. Test definition associated with this test. Data type: Object
"testSpecification": {
 "href": "String",
 "id": "String"
}
testSpecification.hrefHyperlink reference to the service test definition.Data type: String
testSpecification.idSys\_id or external\_id of the service test definition.Data type: String Table: In the sys\_id or external\_id field of the Service Test Definition \[sn\_st\_mgmt\_test\_definition\] table.
validForDate range the service test is valid for.Data type: Object
"validFor": {
 "endDateTime ": "String",
 "startDateTime": "String"
}
validFor.endDateTimeValidity end date of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
validFor.startDateTimeValidity start date of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

HeaderDescription
AcceptData format of the response body. Supported types: application/json or application/xml. Default: application/json
HeaderDescription
None 

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Status codeDescription
200Successful. The request was successfully processed.
400Bad Request. A bad request type or malformed request was detected.
404Not found. The requested item wasn't found.

Response body parameters (JSON or XML)

NameDescription
characteristicList that describes the characteristics of the associated service test.Data type: Array of Objects
"characteristic": [
 {
  "id": "String",
  "name": "String",
  "value": "String",
  "valueType": "String"
 }
]
characteristic.idSys\_id or external\_id of characteristics. If external\_id is present for that record, the response returns the external\_id otherwise it returns the sys\_id.Data type: String Table: Characteristics \[sn\_prd\_pm\_characteristic\]
characteristic.nameName of the characteristic.Data type: String
characteristic.valueCharacteristic options associated with the service test. Characteristics vary based on the customer instance.Data type: String
characteristic.valueTypeType of characteristic value.- choice - date - date/time - duration - email - label - single line test - yes/no Data type: String
descriptionDescription of the service test.Data type: String
idSys\_id or external\_id of the service test definition.Data type: String Table: Service Test \[sn\_st\_mgmt\_test\]
nameName of the service test.Data type: String
relatedServiceTest definition associated for this test.Data type: Object
"relatedService": {
  "href": "string",
  "id": "String",
  "name": "String"
}
relatedService.idSys\_id or external\_id of the product inventory.Data type: String Table: Product Inventory \[sn\_prd\_invt\_product\_inventory\]
relatedService.nameName of the product inventory.Data type: String
testMeasureMeasure of a specific aspect of a product, service, or resource test, such as lost packets or connectivity status.Data type: Array of Objects
"testMeasureDefinition": [
 {
  "accuracy": "String",
  "captureDateTime": "String",
  "captureMethod": "String",
  "id": "String",
  "metricDescription": "String",
  "metricName": "String",
  "ruleViolation": [Array]
  "unitOfMeasure": "String",
  "value": {Object}
 }
]
testMeasure.accuracyFloat decimal value representing the test measure accuracy captured for the associated metrics.Data type: Number Maximum value: 40
testMeasure.captureDateTimeThe date and time that the metric was captured.Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
testMeasure.captureMethodMethod used to capture the metric.Valid values: - automatic: Automatically capture the metric. - manual: Manually capture the metric. - none: Don't capture the metric. Data type: String
testMeasure.idSys\_id or external\_id of the test measure.Data type: String Table: Test Measures \[sn\_st\_mgmt\_test\_measure\]
testMeasure.metricDescriptionBrief description of the metric.Data type: String
testMeasure.metricNameName of a metric in the test measure.Data type: String
testMeasure.ruleViolationObject for defining a rule in the threshold rule definition, along with consequences if the rule is violated.Data type: Array of Objects
"RuleViolation": [
{
  "appliedConsequence": [Array],
  "conformanceComparatorExact": Boolean,
  "conformanceComparatorLower": "String",
  "conformanceComparatorUpper": "String",
  "conformanceTargetExact": "String",
  "conformanceTargetLower": "String",
  "conformanceTargetUpper": "String",
  "description": "String",
  "id": "String",
  "name": "String",
  "numberOfAllowedCrossing": Number,
  "thresholdRuleSeverity": "String",
  "tolerancePeriod": {Object}
 }
]
testMeasure.ruleViolation.appliedConsequenceAction \(prescribed action or notification\) to take when a threshold rule is violated.Data type: Array of Objects
"appliedConsequence": [
 {
  "appliedAction": "String",
  "description": "String",
  "id": "String",
  "name": "String",
  "repeatAction": Boolean
 }
]
testMeasure.ruleViolation.appliedConsequence.appliedActionAction to take when a threshold rule is violated. For example, sending a warning or generating a report. Applied actions can vary between instances.Data type: String
testMeasure.ruleViolation.appliedConsequence.appliedAction.repeatActionFlag that indicates whether to repeat the applied action or not.Valid values: - true: Repeats the action. - false: Doesn't repeat the action. Data type: Boolean Default: false
testMeasure.ruleViolation.appliedConsequence.descriptionDescription of the applied consequence.Data type: String
testMeasure.ruleViolation.appliedConsequence.idSys\_id or external\_id of the applied consequence.Data type: String
testMeasure.ruleViolation.appliedConsequence.nameName of the applied consequence.Data type: String
testMeasure.ruleViolation.conformanceComparatorExact

Flag that indicates whether a value is identical to the value of conformanceTargetExact.Valid values:

  • true: The value is identical.
  • false: The value isn't identical.

Data type: Boolean

Default: false

testMeasure.ruleViolation.conformanceComparatorLowerAn operator that checks if a value falls below the threshold. Valid values: - greater than - is Data type: String
testMeasure.ruleViolation.conformanceComparatorUpperAn operator that checks if a value exceeds the threshold.Valid values: - is - lesser than Data type: String
testMeasure.ruleViolation.conformanceTargetExactRequired if conformanceComparatorExact is set to true. If the conformanceComparatorExact value is set to true, its value matches the value defined in conformanceTargetExact.Data type: Number
testMeasure.ruleViolation.conformanceTargetLowerLower threshold value for comparing the test measure results. Determines if the threshold is crossed or no longer crossed.Data type: Number
testMeasure.ruleViolation.conformanceTargetUpperUpper threshold value for comparing the test measure results. Determines if the threshold is crossed or no longer crossed.Data type: Number
testMeasure.ruleViolation.descriptionDescription of the threshold rule violation.Data type: String
testMeasure.ruleViolation.idSys\_id or external\_id of the threshold rule violation.Data type: String Table: Threshold Rule Violation \[sn\_st\_mgmt\_threshold\_rule\_violation\]
testMeasure.ruleViolation.numberOfAllowedCrossingMaximum crossings allowed within the tolerance period before consequences are applied.Data type: Number Maximum: 40
testMeasure.ruleViolation.thresholdRuleSeveritySeverity of the threshold rule.Valid values: - high - low - medium Data type: String
testMeasure.ruleViolation.tolerancePeriodDuration or time interval in which allowed crossings can occur before a consequence is initiated.Date type: Object
"tolerancePeriod": {
 "amount": Number,
 "units": "String"
}
testMeasure.ruleViolation.tolerancePeriod.amountAmount of the period in number.Data type: Number
testMeasure.ruleViolation.tolerancePeriod.unitsUnits of the period.Valid values: - days - hours - minutes - seconds Data type: String
testMeasure.unitOfMeasureMeasurable value of time used to calculate the performance of a service in days, minutes, and seconds.Data type: String
testMeasure.valueValue of metric in the test.Data type: Object
"value": {
  "id": "String",
  "name": "String",
  "valueType": "String",
  "value": "String"
}
testMeasure.value.idID of the metric value in the test.Data type: String
testMeasure.value.nameName of the metric value in the test.Data type: String
testMeasure.value.valueValue of metric in the test.Data type: String
testMeasure.value.valueTypeType of test measure value such as numeric, text, and so forth.Data type: String
testSpecificationTest definition associated for this test. Data type: Object
"testSpecification": {
  "href": "String",
  "id": "String"
}
testSpecification.hrefHyperlink reference to the service test definition.Data type: String
testSpecification.idSys\_id or external\_id of the service test definition.Data type: String Table: Service Test Definition \[sn\_st\_mgmt\_test\_definition\]
validForDate range that the service test is valid for.Data type: Object
"validFor": {
  "endDateTime": "String",
  "startDateTime": "String"
}
validFor.endDateTimeEnd date and timestamp of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
validFor.startDateTimeStart date and timestamp of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.

cURL request

The following example updates the given service test entity according to details provided in the request body.

curl "http://instance.servicenow.com/api/sn_sprb_mgmt/servicetestmanagement/serviceTest/2b406ec043b202104fefe4511fb8f211" \ 
--request PATCH \
--header "Accept:application/json" \
--user 'username':'password'
--data {
  "description": "Service test description",
  "endDateTime": "2025-01-31 15:05:43",
  "mode": "proactive",
  "name": "Speed Test TR0001002",
  "startDateTime": "2024-06-05 09:07:10",
  "validFor": {
    "startDateTime": "",
    "endDateTime": ""
  },
  "relatedService": {
    "id": "fa6d13f45b5620102dff5e92dc81c77f",
    "name": "Internet_VPLS_PI0000011"
  },
  "testSpecification": {
    "href": "/api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/76a3b160432a02104fefe4511fb8f2ad",
    "id": "76a3b160432a02104fefe4511fb8f2ad"
  },
  "characteristic": [
    {
      "id": "e7ef960443f202104fefe4511fb8f224",
      "name": "AccessRequired",
      "valueType": "yes_no",
      "value": "No"
    }
  ],
  "testMeasure": [
    {
      "id": "61d1382e3be28210d140068aa4e45a2e",
      "accuracy": "0.0001",
      "captureDateTime": "",
      "captureMethod": "automatic",
      "metricDescription": "",
      "metricName": "Flow speed",
      "unitOfMeasure": "A second",
      "value": "3000",
      "ruleViolation": [
        {
          "id": "61d1382e3be28210d140068aa4e45a2f",
          "description": "This speed is greater than the target",
          "name": "tooMuchTraffic",
          "numberOfAllowedCrossing": "0",
          "thresholdRuleSeverity": "high",
          "tolerancePeriod": "",
          "conformanceTargetLower": "2500",
          "conformanceComparatorLower": "greater than",
          "appliedConsequence": [
            {
              "id": "65d1382e3be28210d140068aa4e45a31",
              "appliedAction": "sendWarning",
              "description": "send a warning to the system",
              "name": "sendWarning",
              "repeatAction": "0"
            }
          ]
        }
      ]
    }
  ]
}

The response shows a successful update by returning the modified information in the given test service.

{
  "description": "Service test description",
  "endDateTime": "2025-01-31 15:05:43",
  "mode": "proactive",
  "name": "Speed Test TR0001002",
  "startDateTime": "2024-06-05 09:07:10",
  "validFor": {
    "startDateTime": "",
    "endDateTime": ""
  },
  "relatedService": {
    "id": "fa6d13f45b5620102dff5e92dc81c77f",
    "name": "Internet_VPLS_PI0000011"
  },
  "testSpecification": {
    "href": "/api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/76a3b160432a02104fefe4511fb8f2ad",
    "id": "76a3b160432a02104fefe4511fb8f2ad"
  },
  "characteristic": [
    {
      "id": "e7ef960443f202104fefe4511fb8f224",
      "name": "AccessRequired",
      "valueType": "yes_no",
      "value": "yes"
    }
  ],
  "testMeasure": [
    {
      "id": "61d1382e3be28210d140068aa4e45a2e",
      "accuracy": "0.0001",
      "captureDateTime": "",
      "captureMethod": "automatic",
      "metricDescription": "",
      "metricName": "Flow speed",
      "unitOfMeasure": "A second",
      "value": "3000",
      "ruleViolation": [
        {
          "id": "61d1382e3be28210d140068aa4e45a2f",
          "description": "This speed is greater than the target",
          "name": "tooMuchTraffic",
          "numberOfAllowedCrossing": "0",
          "thresholdRuleSeverity": "high",
          "tolerancePeriod": "",
          "conformanceTargetLower": "2500",
          "conformanceComparatorLower": "greater than",
          "appliedConsequence": [
            {
              "id": "65d1382e3be28210d140068aa4e45a31",
              "appliedAction": "sendWarning",
              "description": "send a warning to the system",
              "name": "sendWarning",
              "repeatAction": "0"
            }
          ]
        }
      ]
    }
  ]
}

Service Test Management Open API - PATCH /sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/{id}

Allows partial updates of a service test definition entity.

URL format

Default URL: /api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/{id}

Supported request parameters

NameDescription
idSys\_id or external\_id of the service test definition to retrieve.Data type: String Table: Service Test Definition \[sn\_st\_mgmt\_test\_definition\]
NameDescription
None 
NameDescription
descriptionDescription of the service test definition.Data type: String
nameRequired. Name of the service test definition.Data type: String
relatedServiceSpecificationRequired. Service specifications of the test definition.Data type: Array of Objects
"relatedServiceSpecification": [
  {
    "id": "String",
    "name": "String"
  }
]
relatedServiceSpecification.idSys\_id or external\_id of the service specification.Data type: String Table: In the sys\_id or external\_id field of the Specification \[sn\_prd\_pm\_specification\] table.
relatedServiceSpecification.nameName of the service specification.Data type: String
serviceTestSpecRelationshipRelated service test definition.Data type: Array of Objects
"serviceTestSpecRelationship": [
 {
  "id": "String",
  "name": "String",
  "relationshipType": "String"
 }
]
serviceTestSpecRelationship.idSys\_id or external\_id of the related service test definition.Data type: String Table: Test Definition \[sn\_st\_mgmt\_test\_definition\]
serviceTestSpecRelationship.nameName of the related test definition.Data type: String
serviceTestSpecRelationship.relationshipTypeType of relationship.Accepted values: - dependency - exclusivity - substitution Data type: String
specCharacteristicCharacteristics of the test definition.Data type: Array of Objects
"specCharacteristic": [
 {
  "characteristicValueSpecification": [Array],
  "description": "String",
  "name": "String",
  "validFor": {Object},
  "valueType": "String"
 }
]
specCharacteristic.characteristicValueSpecificationPossible values of the characteristic.Data type: Array of Objects
"characteristicValueSpecification": [
  {
    "value": "String"
  }
]
specCharacteristic.characteristicValueSpecification.valueValue of the characteristic.Data type: String
specCharacteristic.descriptionDescription of the characteristic.Data type: String
specCharacteristic.nameName of the characteristic.Data type: String
specCharacteristic.validForDate range that the characteristic is valid for.Data type: Object
"validFor": {
 "endDateTime": "String",
 "startDateTime": "String"
}
specCharacteristic.validFor.endDateTimeEnd date of the characteristic. Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. Data type: String
specCharacteristic.validFor.startDateTimeStart date of the characteristic. Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. Data type: String
specCharacteristic.valueTypeType of characteristic value.- choice - date - date/time - duration - email - label - single line test - yes/no Data type: String
testMeasureDefinitionTest measure definitions for this service test definition. For more information, see Define test measure definitions for a service test.Data type: Array of objects
"testMeasureDefinition": [
 {
  "captureFrequency": "String",
  "captureMethod": "String",
  "capturePeriod": {Object},
  "id": "String",
  "metricDescription": "String",
  "metricName": "String",
  "name": "String",
  "unitOfMeasure": "String",
  "thresholdRule": [Array],
  "validFor": {Object},
  "valueType": "String"
 }
]
testMeasureDefinition.captureFrequencyThe frequency at which to capture the metric. Valid values: - daily - monthly - none - once - weekly Data type: String
testMeasureDefinition.captureMethodMethod used to capture the metric.Valid values: - automatic: Automatically capture the metric. - manual: Manually capture the metric. - none: Doesn't capture the metric. Data type: String
testMeasureDefinition.capturePeriodPeriod or duration of the metric capture.Data type: Object
"capturePeriod": {
  "amount": Number,
  "units": "String"
}
testMeasureDefinition.capturePeriod.amountNumber of capture periods.Data type: Number
testMeasureDefinition.capturePeriod.unitsUnits of the period.Valid values: - days - hours - minutes - seconds Data type: String
testMeasureDefinition.idSys\_id or external\_id of the test measure definitions.Data type: String Table: Test Measure definition table \[sn\_st\_mgmt\_test\_measure\_definition\]
testMeasureDefinition.metricDescriptionBrief description of the metric.Data type: String
testMeasureDefinition.metricNameUser-defined name of a metric in the test measure.Data type: String
testMeasureDefinition.nameName of the test measure definition.Data type: String
testMeasureDefinition.thresholdRuleRule that defines conditions to achieve before applying consequences when a threshold is crossed \(or not crossed\)​ in the test measure definition. For more information, Define threshold rules for a test measure definition.Data type: Array of Objects
{
  "thresholdRule": {
    "consequence": [Array],
    "conformanceComparatorExact": Boolean,
    "conformanceComparatorLower": "String",
    "conformanceComparatorUpper": "String",
    "conformanceTargetExact": "String",
    "conformanceTargetLower": "String",
    "conformanceTargetUpper": "String",
    "consequence": [Array],
    "description": "String",
    "id": "String",
    "name": "String",
    "numberOfAllowedCrossing": Number,
    "thresholdRuleSeverity": "String",
    "tolerancePeriod": {Object}
  }
}
testMeasureDefinition.thresholdRule.conformanceComparatorExact

Flag that indicates whether a value is identical to the value set for testMeasureDefinition.thresholdRule.conformanceTargetExact. If set to true, testMeasureDefinition.thresholdRule.conformanceTargetExact is required.Valid values:

  • true: The value is identical to the value of conformanceTargetExact.
  • false: The value isn't identical conformanceTargetExact.

Data type: Boolean

Default: false

testMeasureDefinition.thresholdRule.conformanceComparatorLowerOperator that checks if a value falls below the threshold. Valid values: - greater than - greater than or is Data type: String
testMeasureDefinition.thresholdRule.conformanceComparatorUpperOperator that checks if a value exceeds the threshold.Valid values: - less than - less than or is Data type: String
testMeasureDefinition.thresholdRule.conformanceTargetExactRequired if conformanceComparatorExact is set to true. If the conformanceComparatorExact value is set to true, its value matches the value defined in conformanceTargetExact.Data type: Number
testMeasureDefinition.thresholdRule.conformanceTargetLowerLower threshold value for comparing the test measure results.Data type: Number
testMeasureDefinition.thresholdRule.conformanceTargetUpperUpper threshold value for comparing the test measure results.Data type: Number
testMeasureDefinition.thresholdRule.consequenceAction \(prescribed action or notification\) to take when a threshold rule is crossed. See Define threshold rules for a test measure definition for more information.Data type: Array of objects
"consequence": [
 {
  "description": "String",
  "id": "String",
  "name": "String",
  "prescribeAction": "String",
  "repeatAction": Boolean,
  "validFor": {
  "endDateTime": "String",
  "startDateTime": "String"
 }
]
testMeasureDefinition.thresholdRule.consequence.descriptionDescription of the consequence. Data type: String
testMeasureDefinition.thresholdRule.consequence.idSys\_id or external\_id of the measure consequence.Data type: String
testMeasureDefinition.thresholdRule.consequence.nameName of the consequence.Data type: String
testMeasureDefinition.thresholdRule.consequence.prescribeActionUser-defined action to take for threshold violations. Actions vary between instances.Data type: String
testMeasureDefinition.thresholdRule.consequence.repeatActionFlag that indicates whether to repeat the applied consequence.Valid values: - true: Repeats the action. - false: Doesn't repeat the action. Data type: Boolean Default: false
testMeasureDefinition.thresholdRule.consequence.validForDate range that the consequence is valid for.Data type: Object
"validFor": {
 "startDateTime": "String",
 "endDateTime ": "String"
}
testMeasureDefinition.thresholdRule.consequence.validFor.endDateTimeValidity end date of the consequence. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
testMeasureDefinition.thresholdRule.consequence.validFor.startDateTimeValidity start date of the consequence. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
testMeasureDefinition.thresholdRule.descriptionDescription of the threshold rule.Data type: String
testMeasureDefinition.thresholdRule.idSys\_id or external\_id of the threshold rules.Data type: String Table: In the sys\_id or external\_id field of the Threshold Rules \[sn\_st\_mgmt\_threshold\_rule\] table.
testMeasureDefinition.thresholdRule.nameName of the threshold rule.Data type: String
testMeasureDefinition.thresholdRule.numberOfAllowedCrossingMaximum crossings allowed within the tolerance period before consequences are applied.Data type: Number Maximum value: 40
testMeasureDefinition.thresholdRule.thresholdRuleSeveritySeverity level of the threshold rule.Valid values: - high - medium - low Data type: String
testMeasureDefinition.unitOfMeasureMeasurable value of time used to calculate the performance of a service in days, minutes, and seconds.Data type: String
testMeasureDefinition.validForDate range that the test measure definition is valid for.Data type: String
"validFor": {
 "endDateTime": "String",
 "startDateTime": "String"
}
testMeasureDefinition.validFor.endDateTimeValidity end date of the test measure definition. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
testMeasureDefinition.validFor.startDateTimeValidity start date of the test measure definition. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

HeaderDescription
AcceptData format of the response body. Supported types: application/json or application/xml. Default: application/json
Content-TypeData format of the request body. Only supports application/json.
HeaderDescription
Content-TypeData format of the response body. Only supports application/json.

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Status codeDescription
200Successful. The request was successfully processed.
400Bad Request. A bad request type or malformed request was detected.
404Not found. The requested item wasn't found.

Response body parameters (JSON or XML)

NameDescription
descriptionDescription of the service test definition.Data type: String
idSys\_id or external\_id of the service test definition.Data type: String Table: Service Test \[sn\_st\_mgmt\_test\]
nameName of the service test definition.Data type: String
relatedServiceSpecificationService specifications for the test definitions.Data type: Array of Objects
"relatedServiceSpecification": [
 {
  "id": "String",
  "name": "String"
 }
]
relatedServiceSpecification.idSys\_id or external\_id of the service specification.Data type: String Table: In the sys\_id or external\_id field of the Specification \[sn\_prd\_pm\_specification\] table.
relatedServiceSpecification.nameName of the service specification.Data type: String
serviceTestSpecRelationshipRelated service test definition.Data type: Array of Objects
"serviceTestSpecRelationship": [
 {
  "id": "String",
  "name": "String",
  "relationshipType": "String"
 }
]
serviceTestSpecRelationship.idSys\_id or external\_id of the related service test definition.Data type: String Table: Test Definition \[sn\_st\_mgmt\_test\_definition\]
serviceTestSpecRelationship.nameName of the related test definition.Data type: String
serviceTestSpecRelationship.relationshipTypeType of relationship.Accepted values: - dependency - exclusivity - substitution Data type: String
specCharacteristicTest definition characteristics.Data type: Array of Objects
"specCharacteristic": [
 {
  "characteristicValueSpecification": [Array],
  "description": "String",
  "name": "String",
  "validFor": {Object},
  "valueType": "String"
 }
]
specCharacteristic.characteristicValueSpecificationPossible values of the characteristic.Data type: Array of Objects
"characteristicValueSpecification": [
 {
  "value": "String"
 }
]
specCharacteristic.characteristicValueSpecification.valueValue of the characteristic.Data type: String
specCharacteristic.descriptionDescription of the characteristic.Data type: String
specCharacteristic.nameName of the characteristic.Data type: String
specCharacteristic.validForDate range the characteristic is valid for.Data type: Object
"validFor": {
  "endDateTime": "String",
  "startDateTime": "String"
}
specCharacteristic.validFor.endDateTimeEnd date of the characteristic. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
specCharacteristic.validFor.startDateTimeStart date of the characteristic. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
specCharacteristic.valueTypeType of characteristic value.- choice - date - date/time - duration - email - label - single line test - yes/no Data type: String
testMeasureDefinitionTest measure definitions for this service test definition. See Define test measure definitions for a service test for more infomation.Data type: Array of Objects
"testMeasureDefinition": [
 {
  "captureFrequency": "String",
  "captureMethod": "String",
  "capturePeriod": {Object},
  "id": "String",
  "metricDescription": "String",
  "metricName": "String",
  "name": "String",
  "unitOfMeasure": "String",
  "thresholdRule": [Array],
  "validFor": {Object},
  "valueType": "String"
 }
]
testMeasureDefinition.captureFrequencyFrequency at which to capture the metric. Valid values: - daily - monthly - none - once - weekly Data type: String
testMeasureDefinition.captureMethodMethod used to capture the metric.Valid values: - automatic: Automatically capture the metric. - manual: Manually capture the metric. - none: Don't capture the metric. Data type: String
testMeasureDefinition.capturePeriodDuration or period of the capture.Data type: Object
"capturePeriod": {
  "amount": Number,
  "units": "String"
}
testMeasureDefinition.capturePeriod.amountNumber of capture periods.Data type: Number
testMeasureDefinition.capturePeriod.unitsUnits of the period.Accepted values: - days - hours - minutes - seconds Data type: String
testMeasureDefinition.idSys\_id or external\_id of the Test Measure definitions.Data type: String Table: Test Measure definition \[sn\_st\_mgmt\_test\_measure\_definition\]
testMeasureDefinition.metricDescriptionBrief description of the metric.Data type: String
testMeasureDefinition.metricNameUser-defined name of a metric in the test measure.Data type: String
testMeasureDefinition.nameName of the test measure definition.Data type: String
testMeasureDefinition.thresholdRuleRule that defines the condition \(raise or clear\) to achieve to apply consequences when a threshold is crossed or ceased to be crossed​ for a particular test measure definition.Data type: Array of Objects
{
  "thresholdRule": {
    "conformanceComparatorExact": Boolean,
    "conformanceComparatorLower": "String",
    "conformanceComparatorUpper": "String",
    "conformanceTargetExact": "String",
    "conformanceTargetLower": "String",
    "conformanceTargetUpper": "String",
    "consequence": [Array],
    "description": "String",
    "id": "String",
    "name": "String",
    "numberOfAllowedCrossing": Number,
    "thresholdRuleSeverity": "String",
    "tolerancePeriod": Object
  }
}
testMeasureDefinition.thresholdRule.conformanceComparatorExact

Flag that indicates whether a value is identical to the value of conformanceTargetExact.Valid values:

  • true: The value is identical to the value of conformanceTargetExact.
  • false: The value isn't identical conformanceTargetExact.

Data type: Boolean

Default: false

testMeasureDefinition.thresholdRule.conformanceComparatorLowerOperator that checks if a value falls below the threshold. Valid values: - greater than - is Data type: String
testMeasureDefinition.thresholdRule.conformanceComparatorUpperOperator that checks if a value exceeds the threshold.Valid values: - lesser than - is Data type: String
testMeasureDefinition.thresholdRule.conformanceTargetExactRequired if conformanceComparatorExact is set to true. If the conformanceComparatorExact value is set to true, its value matches the value defined in conformanceTargetExact.Data type: Number
testMeasureDefinition.thresholdRule.conformanceTargetLowerLower threshold value for comparing the test measure results.Data type: Number
testMeasureDefinition.thresholdRule.conformanceTargetUpperUpper threshold value for comparing the test measure results.Data type: Number
testMeasureDefinition.thresholdRule.consequenceAction \(prescribed action or notification\) to take when a threshold rule is crossed.Data type: Array of Objects
"consequence": [
 {
  "description": "String",
  "id": "String",
  "name": "String",
  "prescribeAction": "String",
  "repeatAction": Boolean,
  "validFor": {
  "endDateTime": "String",
  "startDateTime": "String"
 }
]
testMeasureDefinition.thresholdRule.consequence.descriptionDescription of the consequence. Data type: String
testMeasureDefinition.thresholdRule.consequence.idSys\_id or external\_id of the measure consequence.Data type: String
testMeasureDefinition.thresholdRule.consequence.nameName of the consequence.Data type: String
testMeasureDefinition.thresholdRule.consequence.prescribeActionUser-defined action to take for threshold violations. Actions vary between instances.Data type: String
testMeasureDefinition.thresholdRule.consequence.repeatActionFlag that indicates whether to repeat the applied action or not.Valid values: - true: Repeats the action. - false: Doesn't repeat the action. Data type: Boolean Default: false
testMeasureDefinition.thresholdRule.consequence.validForDate range that the consequence is valid for.Data type: Object
"validFor": {
 "startDateTime": "String",
 "endDateTime ": "String"
}
testMeasureDefinition.thresholdRule.consequence.validFor.endDateTimeValidity end date of the consequence. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
testMeasureDefinition.thresholdRule.consequence.validFor.startDateTimeValidity start date of the consequence. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
testMeasureDefinition.thresholdRule.descriptionDescription of the threshold rule.Data type: String
testMeasureDefinition.thresholdRule.idSys\_id or external\_id of the threshold rules.Data type: String Table: Threshold Rules \[sn\_st\_mgmt\_threshold\_rule\]
testMeasureDefinition.thresholdRule.nameName of the threshold rule.Data type: String
testMeasureDefinition.thresholdRule.numberOfAllowedCrossingMaximum crossings allowed within the tolerance period before consequences are applied.Data type: Number Maximum value: 40
testMeasureDefinition.thresholdRule.thresholdRuleSeveritySeverity of the threshold rule.Valid values: - high - low - medium Data type: String
testMeasureDefinition.unitOfMeasureMeasurable value of time used to calculate the performance of a service in days, minutes, and seconds.Data type: String
testMeasureDefinition.validForDate range the test measure definition is valid for.Data type: Object
"validFor": {
 "endDateTime": "String",
 "startDateTime": "String"
}
testMeasureDefinition.validFor.endDateTimeValidity end date of the test measure definition. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
testMeasureDefinition.validFor.startDateTimeValidity start date of the test measure definition. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.

cURL request

The following example partially updates the given service test definition ID according to modifications provided in the request body.

curl "http://instance.servicenow.com/api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/89d2b920432a02104fefe4511fb8f22e " 
--request PATCH
--header "Accept:application/json" 
--user 'username':'password'
--data {
  "description": "Upstream and Downstream speed ",
  "name": "This is my new Speed Test",
  "testMeasureDefinition": [
    {
      "id": "1a04f560432a02104fefe4511fb8f2ad",
      "captureFrequency": "once",
      "captureMethod": "automatic",
      "metricDescription": "This is the downstream speed in a service",
      "metricName": "Downstream Speed",
      "name": "Downstream Speed",
      "unitOfMeasure": "a second",
      "valueType": "",
      "capturePeriod": "30 Minutes",
      "validFor": {
        "startDateTime": "2024-05-30 08:49:26",
        "endDateTime": "2024-05-31 08:49:29"
      },
      "thresholdRule": [
        {
          "id": "a754f960432a02104fefe4511fb8f2d0",
          "description": "This speed is greater than the target upper",
          "name": "InternetSpeedValue",
          "numberOfAllowedCrossing": "0",
          "thresholdRuleSeverity": "high",
          "tolerancePeriod": "15 Minutes",
          "conformanceTargetLower": "75",
          "conformanceComparatorLower": "greater than",
          "consequence": [
            {
              "id": "15a4bd60432a02104fefe4511fb8f2b8",
              "prescribeAction": "null",
              "description": "generate a waring report",
              "name": "degradedQualityOfService",
              "repeatAction": "0",
              "validFor": {
                "startDateTime": "2024-05-30 08:51:29",
                "endDateTime": "2024-08-06 08:51:31"
              }
            },
            {
              "id": "e6847d60432a02104fefe4511fb8f2c3",
              "prescribeAction": "null",
              "description": "send a warning to the system",
              "name": "packetdrop",
              "repeatAction": "0",
              "validFor": {
                "startDateTime": "2024-05-30 08:50:53",
                "endDateTime": "2024-08-06 08:50:55"
              }
            }
          ]
        },
        {
          "id": "cb55b5a0432a02104fefe4511fb8f201",
          "description": "",
          "name": "InternetSpeedValue",
          "numberOfAllowedCrossing": "0",
          "thresholdRuleSeverity": "medium",
          "tolerancePeriod": "",
          "conformanceTargetUpper": "120",
          "conformanceComparatorUpper": "less than",
          "consequence": []
        }
      ]
    },
    {
      "id": "8f987524432a02104fefe4511fb8f2f0",
      "captureFrequency": "once",
      "captureMethod": "automatic",
      "metricDescription": "This is the upstream speed in the service",
      "metricName": "Upstream Speed",
      "name": "Upstream Speed",
      "unitOfMeasure": "a second",
      "valueType": "",
      "capturePeriod": "",
      "validFor": {
        "startDateTime": "",
        "endDateTime": ""
      },
      "thresholdRule": []
    }
  ],
  "specCharacteristic": [
    {
      "name": "restart",
      "description": "restart",
      "valueType": "yes_no",
      "validFor": {
        "startDatetime": "2024-05-30 08:45:49"
      }
    }
  ],
  "serviceTestSpecRelationship": [
    {
      "id": "76a3b160432a02104fefe4511fb8f2ad",
      "name": "OAM Test",
      "relationshipType": ""
    }
  ],
  "relatedServiceSpecification": [
    {
      "id": "aeddcd1fb7d69910ff00f203ae11a990",
      "name": "Home Internet"
    }
  ]
}

The response body returns the updated portion of the service test specification:

{
  "description": "Upstream and Downstream speed ",
  "name": "This is my new Speed Test",
  "testMeasureDefinition": [
    {
      "id": "1a04f560432a02104fefe4511fb8f2ad",
      "captureFrequency": "once",
      "captureMethod": "automatic",
      "metricDescription": "This is the downstream speed in a service",
      "metricName": "Downstream Speed",
      "name": "Downstream Speed",
      "unitOfMeasure": "a second",
      "valueType": "",
      "capturePeriod": "30 Minutes",
      "validFor": {
        "startDateTime": "2024-05-30 08:49:26",
        "endDateTime": "2024-05-31 08:49:29"
      },
      "thresholdRule": [
        {
          "id": "a754f960432a02104fefe4511fb8f2d0",
          "description": "This speed is greater than the target upper",
          "name": "InternetSpeedValue",
          "numberOfAllowedCrossing": "0",
          "thresholdRuleSeverity": "high",
          "tolerancePeriod": "15 Minutes",
          "conformanceTargetLower": "75",
          "conformanceComparatorLower": "greater than",
          "consequence": [
            {
              "id": "15a4bd60432a02104fefe4511fb8f2b8",
              "prescribeAction": "null",
              "description": "generate a waring report",
              "name": "degradedQualityOfService",
              "repeatAction": "0",
              "validFor": {
                "startDateTime": "2024-05-30 08:51:29",
                "endDateTime": "2024-08-06 08:51:31"
              }
            },
            {
              "id": "e6847d60432a02104fefe4511fb8f2c3",
              "prescribeAction": "null",
              "description": "send a warning to the system",
              "name": "packetdrop",
              "repeatAction": "0",
              "validFor": {
                "startDateTime": "2024-05-30 08:50:53",
                "endDateTime": "2024-08-06 08:50:55"
              }
            }
          ]
        },
        {
          "id": "cb55b5a0432a02104fefe4511fb8f201",
          "description": "",
          "name": "InternetSpeedValue",
          "numberOfAllowedCrossing": "0",
          "thresholdRuleSeverity": "medium",
          "tolerancePeriod": "",
          "conformanceTargetUpper": "120",
          "conformanceComparatorUpper": "less than",
          "consequence": []
        }
      ]
    },
    {
      "id": "8f987524432a02104fefe4511fb8f2f0",
      "captureFrequency": "once",
      "captureMethod": "automatic",
      "metricDescription": "This is the upstream speed in the service",
      "metricName": "Upstream Speed",
      "name": "Upstream Speed",
      "unitOfMeasure": "a second",
      "valueType": "",
      "capturePeriod": "",
      "validFor": {
        "startDateTime": "",
        "endDateTime": ""
      },
      "thresholdRule": []
    }
  ],
  "specCharacteristic": [
    {
      "name": "restart",
      "description": "restart",
      "valueType": "yes_no",
      "validFor": {
        "startDatetime": "2024-05-30 08:45:49"
      }
    }
  ],
  "serviceTestSpecRelationship": [
    {
      "id": "76a3b160432a02104fefe4511fb8f2ad",
      "name": "OAM Test",
      "relationshipType": ""
    }
  ],
  "relatedServiceSpecification": [
    {
      "id": "aeddcd1fb7d69910ff00f203ae11a990",
      "name": "Home Internet"
    }
  ]
}

Service Test Management Open API - POST /sn_sprb_mgmt/servicetestmanagement/serviceTest

Creates a service test.

URL format

Default URL: /api/sn_sprb_mgmt/servicetestmanagement/serviceTest

Supported request parameters

NameDescription
None 
NameDescription
None 
NameDescription
characteristicList that describes the characteristics of the associated service test. For more information about test definition characteristics, see Data type: Array of Objects
"characteristic": [
 {
  "id": "String",
  "name": "String",
  "value": "String",
  "valueType": "String"
 }
]
characteristic.idSys\_id or external\_id of characteristics. If external\_id is present for that record, the response returns the external\_id otherwise it returns the sys\_id.Data type: String Table: Characteristics \[sn\_prd\_pm\_characteristic\]
characteristic.nameName of the characteristic.Data type: String
characteristic.valueCharacteristic options associated with the service test. Characteristics vary based on the customer instance.Data type: String
characteristic.valueTypeType of characteristic value.- choice - date - date/time - duration - email - label - single line test - yes/no Data type: String
descriptionDescription of the service test.Data type: String
endDateTimeEnd date and time of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
idSys\_id or external\_id of the service test. This ID creates a service test and is used as the external\_id.Data type: String Table: Service Test \[sn\_st\_mgmt\_test\]
modeMode that the service test is running in.Valid values: - ONDEMAND: Triggers the service test manually. - PROACTIVE: Triggers the service test automatically. Data type: String Default: ONDEMAND
nameRequired. Name of the service test.Data type: String
relatedServiceRequired. Test definition associated with the service test.Data type: Object
"relatedService": {
 "href": "String",
 "id": "String",
 "name": "String"
}
relatedService.hrefHyperlink reference to the related service.Data type: String
relatedService.idSys\_id or external\_id of the product inventory.Data type: String Table: In the sys\_id or external\_id field of the product Inventory \[sn\_prd\_invt\_product\_inventory\] table.
relatedService.nameName of the product inventory item.Data type: String
startDateTimeStart date and time of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
stateState the service test is in. Valid values: - acknowledged - canceled - completed - failed - inProgress - pending - rejected Data type: String
testMeasureMeasure of a specific aspect of a product, service, or resource test, such as lost packets or connectivity status.Data type: Array of Objects
"testMeasure": [
 {
 "accuracy": "String",
 "captureDateTime": "String",
 "captureMethod": "String",
 "id": "String",
 "metricDescription": "String",
 "metricName": "String",
 "ruleViolation": [Array],
 "unitOfMeasure": "String",
 "value": {Object}
 }
]
testMeasure.accuracyFloat decimal value representing the test measure accuracy captured for the associated metrics.Data type: Number Maximum value: 40
testMeasure.captureDateTimeThe date and time that the metric was captured. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
testMeasure.idSys\_id or external\_id of the Test Measures.Data type: String Table: In the sys\_id or external\_id fields of the Test Measures table \[sn\_st\_mgmt\_test\_measure\] table.
testMeasure.Measure.captureMethodMethod used to capture the metric.Valid values: - automatic: Automatically capture the metric. - manual: Manually capture the metric. - none: Don't capture the metric. Data type: String
testMeasure.metricDescriptionBrief description of the metric.Data type: String
testMeasure.metricNameName of the test measure metric.Data type: String
testMeasure.ruleViolationAn object for defining a rule in the threshold rule definition, along with consequences if the rule is violated.Data type: Array of Objects
"ruleViolation"[
  {
    appliedConsequence: [Array],
    conformanceTargetUpper: Number,
    conformanceComparatorUpper: "String",
    description: "String",
    id: "String",
    name: "String",
    numberOfAllowedCrossing: Number,
    thresholdRuleSeverity: "String",
    tolerancePeriod: "String"
  }
]
testMeasure.ruleViolation.appliedConsequenceAction \(prescribed action or notification\) to take when a threshold rule is crossed.Data type: Array of Objects
"appliedConsequence": [
 {
  "appliedAction": "String",
  "description": "String",
  "id": "String",
  "name": "String",
  "repeatAction": Boolean
 }
]
testMeasure.ruleViolation.appliedConsequence.appliedActionAction to take when a threshold rule is violated. For example, sending a warning or generating a report. Applied actions can vary between instances.Data type: String
testMeasure.ruleViolation.appliedConsequence.descriptionDescription of the applied consequence.Data type: String
testMeasure.ruleViolation.appliedConsequence.idSys\_id or external\_id of the applied consequence.Data type: String
testMeasure.ruleViolation.appliedConsequence.nameName of the applied consequence.Data type: String
testMeasure.ruleViolation.appliedConsequence.repeatActionFlag that indicates whether to repeat the consequence when a second violation occurs.Valid values: - true: Repeat the action. - false: Don't repeat the action. Data type: Boolean Default: false
testMeasure.ruleViolation.conformanceComporatorExactFlag that indicates whether a value is identical.Valid values: - true: The value is identical. - false: The value isn't identical. Data type: Boolean Default: false
testMeasure.ruleViolation.conformanceComporatorLowerOperator for checking if a value falls below the threshold.Valid values: - greater than - greater than or is Data type: String
testMeasure.ruleViolation.conformanceComporatorUpperOperator for checking if a value is above the threshold.Valid values: - less than - less than or is Data type: String
testMeasure.ruleViolation.conformanceTargetExactRequired if conformanceComparatorExact is set to true. If the conformanceComparatorExact value is set to true, its value matches the value defined in conformanceTargetExact.Data type: Number
testMeasure.ruleViolation.conformanceTargetLowerLower threshold value for comparing the test measure results. Determines if the threshold is crossed or no longer crossed.Data type: Number
testMeasure.ruleViolation.conformanceTargetUpperUpper threshold value for comparing the test measure results. Determines if the threshold is crossed or no longer crossed.Data type: Number
testMeasure.ruleViolation.descriptionDescription of the threshold rule.Data type: String
testMeasure.ruleViolation.idSys\_id or external\_id of the threshold rule violation.Data type: String Table: Threshold Rule Violation \[sn\_st\_mgmt\_threshold\_rule\_violation\]
testMeasure.ruleViolation.nameName of the threshold rule.Data type: String
testMeasure.ruleViolation.numberOfAllowedCrossingMaximum crossings allowed within the tolerance period before consequences are applied.Data type: Number Maximum value: 40
testMeasure.ruleViolation.thresholdRuleSeveritySeverity of the threshold rule.Valid values: - high - medium - low Data type: String
testMeasure.ruleViolation.tolerancePeriodSpecified time interval during which crossing occurrences are enabled without triggering any immediate consequences or actions.Date type: Object
"tolerancePeriod": {
 "amount": Number,
 "units": "String"
}
testMeasure.ruleViolation.tolerancePeriod.amountNumber of periods before applying the consequence.Data type: Number
testMeasure.ruleViolation.tolerancePeriod.unitsUnits of the period.Valid values: - days - hours - minutes - seconds Data type: String
testMeasure.unitOfMeasureUnit of measurement for the conformance target values of the test measure.Data type: String
testMeasure.valueValue of the test measure.Data type: Object
"value": {
 "id": "String",
 "name": "String",
 "valueType": "String",
 "value": "String
}
testMeasure.value.idID of the test measure value.Data type: String
testMeasure.value.nameName of the test measure value.Data type: String
testMeasure.value.valueValue of the test measure.Data type: String
testMeasure.value.valueTypeType of test measure value such as numeric, text, and so forth.Data type: String
testSpecificationRequired. Test definition associated with this test. Data type: Object
"testSpecification": {
 "href": "String",
 "id": "String"
}
testSpecification.hrefHyperlink reference to the service test definition.Data type: String
testSpecification.idSys\_id or external\_id of the service test definition.Data type: String Table: In the sys\_id or external\_id field of the Service Test Definition \[sn\_st\_mgmt\_test\_definition\] table.
validForDate range the service test is valid for.Data type: Object
"validFor": {
 "endDateTime ": "String",
 "startDateTime": "String"
}
validFor.endDateTimeValidity end date of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
validFor.startDateTimeValidity start date of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

HeaderDescription
AcceptData format of the response body. Supported types: application/json or application/xml. Default: application/json
HeaderDescription
None 

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Status codeDescription
200Successful. The request was successfully processed.
400Bad Request. A bad request type or malformed request was detected.

Response body parameters (JSON or XML)

NameDescription
characteristicList that describes the characteristics of the associated service test.Data type: Array of Objects
"characteristic": [
 {
  "id": "String",
  "name": "String",
  "value": "String",
  "valueType": "String"
 }
]
characteristic.idSys\_id or external\_id of characteristics. If external\_id is present for that record, the response returns the external\_id otherwise it returns the sys\_id.Data type: String Table: Characteristics \[sn\_prd\_pm\_characteristic\]
characteristic.nameName of the characteristic.Data type: String
characteristic.valueCharacteristic options associated with the service test. Characteristics vary based on the customer instance.Data type: String
characteristic.valueTypeType of characteristic value.- choice - date - date/time - duration - email - label - single line test - yes/no Data type: String
descriptionDescription of the service test.Data type: String
endDateTimeEnd date and time of the service test.Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
idSys\_id or external\_id of the service test definition.Data type: String Table: Service Test \[sn\_st\_mgmt\_test\]
modeMode that the service test is running in.Valid values: - ONDEMAND: Triggers the service test manually. - PROACTIVE: Triggers the service test automatically. Data type: String Default: ONDEMAND
nameName of the service test.Data type: String
relatedServiceTest definition associated for this test.Data type: Object
"relatedService": {
  "href": "string",
  "id": "String",
  "name": "String"
}
relatedService.idSys\_id or external\_id of the product inventory.Data type: String Table: Product Inventory \[sn\_prd\_invt\_product\_inventory\]
relatedService.nameName of the product inventory.Data type: String
startDateTimeStart date and time of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
stateState of the service test.Valid values: - acknowledged - canceled - completed - failed - inProgress - pending - rejected Data type: String
testMeasureMeasure of a specific aspect of a product, service, or resource test, such as lost packets or connectivity status.Data type: Array of Objects
"testMeasureDefinition": [
 {
  "accuracy": "String",
  "captureDateTime": "String",
  "captureMethod": "String",
  "id": "String",
  "metricDescription": "String",
  "metricName": "String",
  "ruleViolation": [Array]
  "unitOfMeasure": "String",
  "value": {Object}
 }
]
testMeasure.accuracyFloat decimal value representing the test measure accuracy captured for the associated metrics.Data type: Number Maximum value: 40
testMeasure.captureDateTimeThe date and time that the metric was captured.Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
testMeasure.captureMethodMethod used to capture the metric.Valid values: - automatic: Automatically capture the metric. - manual: Manually capture the metric. - none: Don't capture the metric. Data type: String
testMeasure.idSys\_id or external\_id of the test measure.Data type: String Table: Test Measures \[sn\_st\_mgmt\_test\_measure\]
testMeasure.metricDescriptionBrief description of the metric.Data type: String
testMeasure.metricNameName of a metric in the test measure.Data type: String
testMeasure.ruleViolationObject for defining a rule in the threshold rule definition, along with consequences if the rule is violated.Data type: Array of Objects
"RuleViolation": [
{
  "appliedConsequence": [Array],
  "conformanceComparatorExact": Boolean,
  "conformanceComparatorLower": "String",
  "conformanceComparatorUpper": "String",
  "conformanceTargetExact": "String",
  "conformanceTargetLower": "String",
  "conformanceTargetUpper": "String",
  "description": "String",
  "id": "String",
  "name": "String",
  "numberOfAllowedCrossing": Number,
  "thresholdRuleSeverity": "String",
  "tolerancePeriod": {Object}
 }
]
testMeasure.ruleViolation.appliedConsequenceAction \(prescribed action or notification\) to take when a threshold rule is violated.Data type: Array of Objects
"appliedConsequence": [
 {
  "appliedAction": "String",
  "description": "String",
  "id": "String",
  "name": "String",
  "repeatAction": Boolean
 }
]
testMeasure.ruleViolation.appliedConsequence.appliedActionAction to take when a threshold rule is violated. For example, sending a warning or generating a report. Applied actions can vary between instances.Data type: String
testMeasure.ruleViolation.appliedConsequence.appliedAction.repeatActionFlag that indicates whether to repeat the applied action or not.Valid values: - true: Repeats the action. - false: Doesn't repeat the action. Data type: Boolean Default: false
testMeasure.ruleViolation.appliedConsequence.descriptionDescription of the applied consequence.Data type: String
testMeasure.ruleViolation.appliedConsequence.idSys\_id or external\_id of the applied consequence.Data type: String
testMeasure.ruleViolation.appliedConsequence.nameName of the applied consequence.Data type: String
testMeasure.ruleViolation.conformanceComparatorExact

Flag that indicates whether a value is identical to the value of conformanceTargetExact.Valid values:

  • true: The value is identical.
  • false: The value isn't identical.

Data type: Boolean

Default: false

testMeasure.ruleViolation.conformanceComparatorLowerAn operator that checks if a value falls below the threshold. Valid values: - greater than - is Data type: String
testMeasure.ruleViolation.conformanceComparatorUpperAn operator that checks if a value exceeds the threshold.Valid values: - is - lesser than Data type: String
testMeasure.ruleViolation.conformanceTargetExactRequired if conformanceComparatorExact is set to true. If the conformanceComparatorExact value is set to true, its value matches the value defined in conformanceTargetExact.Data type: Number
testMeasure.ruleViolation.conformanceTargetLowerLower threshold value for comparing the test measure results. Determines if the threshold is crossed or no longer crossed.Data type: Number
testMeasure.ruleViolation.conformanceTargetUpperUpper threshold value for comparing the test measure results. Determines if the threshold is crossed or no longer crossed.Data type: Number
testMeasure.ruleViolation.descriptionDescription of the threshold rule violation.Data type: String
testMeasure.ruleViolation.idSys\_id or external\_id of the threshold rule violation.Data type: String Table: Threshold Rule Violation \[sn\_st\_mgmt\_threshold\_rule\_violation\]
testMeasure.ruleViolation.nameName of the threshold rule violation.Date type: String
testMeasure.ruleViolation.numberOfAllowedCrossingMaximum crossings allowed within the tolerance period before consequences are applied.Data type: Number Maximum: 40
testMeasure.ruleViolation.thresholdRuleSeveritySeverity of the threshold rule.Valid values: - high - low - medium Data type: String
testMeasure.ruleViolation.tolerancePeriodDuration or time interval in which allowed crossings can occur before a consequence is initiated.Date type: Object
"tolerancePeriod": {
 "amount": Number,
 "units": "String"
}
testMeasure.ruleViolation.tolerancePeriod.amountAmount of the period in number.Data type: Number
testMeasure.ruleViolation.tolerancePeriod.unitsUnits of the period.Valid values: - days - hours - minutes - seconds Data type: String
testMeasure.unitOfMeasureMeasurable value of time used to calculate the performance of a service in days, minutes, and seconds.Data type: String
testMeasure.valueValue of metric in the test.Data type: Object
"value": {
  "id": "String",
  "name": "String",
  "valueType": "String",
  "value": "String"
}
testMeasure.value.idID of the metric value in the test.Data type: String
testMeasure.value.nameName of the metric value in the test.Data type: String
testMeasure.value.nameName of the metric value in the test.Data type: String
testMeasure.value.valueValue of metric in the test.Data type: String
testMeasure.value.valueTypeType of test measure value such as numeric, text, and so forth.Data type: String
testSpecificationTest definition associated for this test. Data type: Object
"testSpecification": {
  "href": "String",
  "id": "String"
}
testSpecification.hrefHyperlink reference to the service test definition.Data type: String
testSpecification.idSys\_id or external\_id of the service test definition.Data type: String Table: Service Test Definition \[sn\_st\_mgmt\_test\_definition\]
validForDate range that the service test is valid for.Data type: Object
"validFor": {
  "endDateTime": "String",
  "startDateTime": "String"
}
validFor.endDateTimeEnd date and timestamp of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
validFor.startDateTimeStart date and timestamp of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.

cURL request

The following example creates a new service test according to specific details provided in the request body.

curl "https:/instance.servicenow.com/api/sn_sprb_mgmt/servicetestmanagement/serviceTest" \
--request POST \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--data {
  "description": "Service test",
  "endDateTime": "2025-01-31 15:05:43",
  "mode": "proactive",
  "name": "Speed Test TR0001002",
  "startDateTime": "2024-06-05 09:07:10",
  "validFor": {
    "startDateTime": "",
    "endDateTime": ""
  },
  "relatedService": {
    "id": "fa6d13f45b5620102dff5e92dc81c77f",
    "name": "Internet_VPLS_PI0000011"
  },
  "testSpecification": {
    "href": "/api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/76a3b160432a02104fefe4511fb8f2ad",
    "id": "76a3b160432a02104fefe4511fb8f2ad"
  },
  "characteristic": [
    {
      "id": "e7ef960443f202104fefe4511fb8f224",
      "name": "AccessRequired",
      "valueType": "yes_no",
      "value": "Yes"
    }
  ],
  "testMeasure": [
    {
      "id": "61d1382e3be28210d140068aa4e45a2e",
      "accuracy": "0.0001",
      "captureDateTime": "",
      "captureMethod": "automatic",
      "metricDescription": "",
      "metricName": "Flow speed",
      "unitOfMeasure": "A second",
      "value": "3000",
      "ruleViolation": [
        {
          "id": "61d1382e3be28210d140068aa4e45a2f",
          "description": "This speed is greater than the target",
          "name": "tooMuchTraffic",
          "numberOfAllowedCrossing": "0",
          "thresholdRuleSeverity": "high",
          "tolerancePeriod": "",
          "conformanceTargetLower": "2500",
          "conformanceComparatorLower": "greater than",
          "appliedConsequence": [
            {
              "id": "65d1382e3be28210d140068aa4e45a31",
              "appliedAction": "sendWarning",
              "description": "send a warning to the system",
              "name": "sendWarning",
              "repeatAction": "0"
            }
          ]
        }
      ]
    }
  ]
}

The response returns confirmation details about the new test service and assigns it a unique ID, 2b406ec043b202104fefe4511fb8f211:

{
  "description": "Service test",
  "endDateTime": "2025-01-31 15:05:43",
  "mode": "proactive",
  "name": "Speed Test TR0001002",
  "startDateTime": "2024-06-05 09:07:10",
  "validFor": {
    "startDateTime": "",
    "endDateTime": ""
  },
  "relatedService": {
    "id": "fa6d13f45b5620102dff5e92dc81c77f",
    "name": "Internet_VPLS_PI0000011"
  },
  "testSpecification": {
    "href": "/api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification/76a3b160432a02104fefe4511fb8f2ad",
    "id": "76a3b160432a02104fefe4511fb8f2ad"
  },
  "characteristic": [
    {
      "id": "e7ef960443f202104fefe4511fb8f224",
      "name": "AccessRequired",
      "valueType": "yes_no",
      "value": "Yes"
    }
  ],
  "testMeasure": [
    {
      "id": "61d1382e3be28210d140068aa4e45a2e",
      "accuracy": "0.0001",
      "captureDateTime": "",
      "captureMethod": "automatic",
      "metricDescription": "",
      "metricName": "Flow speed",
      "unitOfMeasure": "A second",
      "value": "3000",
      "ruleViolation": [
        {
          "id": "61d1382e3be28210d140068aa4e45a2f",
          "description": "This speed is greater than the target",
          "name": "tooMuchTraffic",
          "numberOfAllowedCrossing": "0",
          "thresholdRuleSeverity": "high",
          "tolerancePeriod": "",
          "conformanceTargetLower": "2500",
          "conformanceComparatorLower": "greater than",
          "appliedConsequence": [
            {
              "id": "65d1382e3be28210d140068aa4e45a31",
              "appliedAction": "sendWarning",
              "description": "send a warning to the system",
              "name": "sendWarning",
              "repeatAction": "0"
            }
          ]
        }
      ]
    }
  ],
  "id": "2b406ec043b202104fefe4511fb8f211"
}

Service Test Management Open API - POST /sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification

Creates a new service test definition.

URL format

Default URL: /api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification

Supported request parameters

NameDescription
None 
NameDescription
None 
NameDescription
descriptionDescription of the service test definition.Data type: String
idSys\_id or external\_id of the service test definition.Data type: String Table: Service Test Definition \[sn\_st\_mgmt\_test\_definition\]
nameRequired. Name of the service test definition.Data type: String
relatedServiceSpecificationRequired. Service specifications of the test definition.Data type: Array of Objects
"relatedServiceSpecification": [
  {
    "id": "String",
    "name": "String"
  }
]
relatedServiceSpecification.idSys\_id or external\_id of the service specification.Data type: String Table: In the sys\_id or external\_id field of the Specification \[sn\_prd\_pm\_specification\] table.
relatedServiceSpecification.nameName of the service specification.Data type: String
serviceTestSpecRelationshipRelated service test definition.Data type: Array of objects
"serviceTestSpecRelationship": [
{
  "id": "String",
  "name": "String",
  "relationshipType": "String"
 }
]
serviceTestSpecRelationship.idSys\_id or external\_id of the related service test definition.Data type: String Table: In the sys\_id or external\_id field of the Test Definition \[sn\_st\_mgmt\_test\_definition\] table.
serviceTestSpecRelationship.nameName of the related test definition.Data type: String
serviceTestSpecRelationship.relationshipTypeType of relationship.Valid values: - dependency - exclusivity - substitution Data type: String
specCharacteristicCharacteristics of the test definition.Data type: Array of Objects
"specCharacteristic": [
 {
  "characteristicValueSpecification": [Array],
  "description": "String",
  "name": "String",
  "validFor": {Object},
  "valueType": "String"
 }
]
specCharacteristic.characteristicValueSpecificationPossible values of the characteristic.Data type: Array of Objects
"characteristicValueSpecification": [
  {
    "value": "String"
  }
]
specCharacteristic.characteristicValueSpecification.valueValue of the characteristic.Data type: String
specCharacteristic.descriptionDescription of the characteristic.Data type: String
specCharacteristic.nameName of the characteristic.Data type: String
specCharacteristic.validForDate range that the characteristic is valid for.Data type: Object
"validFor": {
 "endDateTime": "String",
 "startDateTime": "String"
}
specCharacteristic.validFor.endDateTimeEnd date of the characteristic. Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. Data type: String
specCharacteristic.validFor.startDateTimeStart date of the characteristic. Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`. Data type: String
specCharacteristic.valueTypeType of characteristic value.- choice - date - date/time - duration - email - label - single line test - yes/no Data type: String
testMeasureDefinitionTest measure definitions for this service test definition. For more information, see Define test measure definitions for a service test.Data type: Array of objects
"testMeasureDefinition": [
 {
  "captureFrequency": "String",
  "captureMethod": "String",
  "capturePeriod": {Object},
  "id": "String",
  "metricDescription": "String",
  "metricName": "String",
  "name": "String",
  "unitOfMeasure": "String",
  "thresholdRule": [Array],
  "validFor": {Object},
  "valueType": "String"
 }
]
testMeasureDefinition.captureFrequencyThe frequency at which to capture the metric. Valid values: - daily - monthly - none - once - weekly Data type: String
testMeasureDefinition.captureMethodMethod used to capture the metric.Valid values: - automatic: Automatically capture the metric. - manual: Manually capture the metric. - none: Doesn't capture the metric. Data type: String
testMeasureDefinition.capturePeriodPeriod or duration of the metric capture.Data type: Object
"capturePeriod": {
  "amount": Number,
  "units": "String"
}
testMeasureDefinition.capturePeriod.amountNumber of capture periods.Data type: Number
testMeasureDefinition.capturePeriod.unitsUnits of the period.Valid values: - days - hours - minutes - seconds Data type: String
testMeasureDefinition.idSys\_id or external\_id of the test measure definitions.Data type: String Table: Test Measure definition table \[sn\_st\_mgmt\_test\_measure\_definition\]
testMeasureDefinition.metricDescriptionBrief description of the metric.Data type: String
testMeasureDefinition.metricNameUser-defined name of a metric in the test measure.Data type: String
testMeasureDefinition.nameName of the test measure definition.Data type: String
testMeasureDefinition.thresholdRuleRule that defines conditions to achieve before applying consequences when a threshold is crossed \(or not crossed\)​ in the test measure definition. For more information, Define threshold rules for a test measure definition.Data type: Array of Objects
{
  "thresholdRule": {
    "consequence": [Array],
    "conformanceComparatorExact": Boolean,
    "conformanceComparatorLower": "String",
    "conformanceComparatorUpper": "String",
    "conformanceTargetExact": "String",
    "conformanceTargetLower": "String",
    "conformanceTargetUpper": "String",
    "consequence": [Array],
    "description": "String",
    "id": "String",
    "name": "String",
    "numberOfAllowedCrossing": Number,
    "thresholdRuleSeverity": "String",
    "tolerancePeriod": {Object}
  }
}
testMeasureDefinition.thresholdRule.conformanceComparatorExact

Flag that indicates whether a value is identical to the value set for testMeasureDefinition.thresholdRule.conformanceTargetExact. If set to true, testMeasureDefinition.thresholdRule.conformanceTargetExact is required.Valid values:

  • true: The value is identical to the value of conformanceTargetExact.
  • false: The value isn't identical conformanceTargetExact.

Data type: Boolean

Default: false

testMeasureDefinition.thresholdRule.conformanceComparatorLowerOperator that checks if a value falls below the threshold. Valid values: - greater than - greater than or is Data type: String
testMeasureDefinition.thresholdRule.conformanceComparatorUpperOperator that checks if a value exceeds the threshold.Valid values: - less than - less than or is Data type: String
testMeasureDefinition.thresholdRule.conformanceTargetExactRequired if conformanceComparatorExact is set to true. If the conformanceComparatorExact value is set to true, its value matches the value defined in conformanceTargetExact.Data type: Number
testMeasureDefinition.thresholdRule.conformanceTargetLowerLower threshold value for comparing the test measure results.Data type: Number
testMeasureDefinition.thresholdRule.conformanceTargetUpperUpper threshold value for comparing the test measure results.Data type: Number
testMeasureDefinition.thresholdRule.consequenceAction \(prescribed action or notification\) to take when a threshold rule is crossed. See Define threshold rules for a test measure definition for more information.Data type: Array of objects
"consequence": [
 {
  "description": "String",
  "id": "String",
  "name": "String",
  "prescribeAction": "String",
  "repeatAction": Boolean,
  "validFor": {
  "endDateTime": "String",
  "startDateTime": "String"
 }
]
testMeasureDefinition.thresholdRule.consequence.descriptionDescription of the consequence. Data type: String
testMeasureDefinition.thresholdRule.consequence.idSys\_id or external\_id of the measure consequence.Data type: String
testMeasureDefinition.thresholdRule.consequence.nameName of the consequence.Data type: String
testMeasureDefinition.thresholdRule.consequence.prescribeActionUser-defined action to take for threshold violations. Actions vary between instances.Data type: String
testMeasureDefinition.thresholdRule.consequence.repeatActionFlag that indicates whether to repeat the applied consequence.Valid values: - true: Repeats the action. - false: Doesn't repeat the action. Data type: Boolean Default: false
testMeasureDefinition.thresholdRule.consequence.validForDate range that the consequence is valid for.Data type: Object
"validFor": {
 "startDateTime": "String",
 "endDateTime ": "String"
}
testMeasureDefinition.thresholdRule.consequence.validFor.endDateTimeValidity end date of the consequence. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
testMeasureDefinition.thresholdRule.consequence.validFor.startDateTimeValidity start date of the consequence. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
testMeasureDefinition.thresholdRule.descriptionDescription of the threshold rule.Data type: String
testMeasureDefinition.thresholdRule.idSys\_id or external\_id of the threshold rules.Data type: String Table: In the sys\_id or external\_id field of the Threshold Rules \[sn\_st\_mgmt\_threshold\_rule\] table.
testMeasureDefinition.thresholdRule.nameName of the threshold rule.Data type: String
testMeasureDefinition.thresholdRule.numberOfAllowedCrossingMaximum crossings allowed within the tolerance period before consequences are applied.Data type: Number Maximum value: 40
testMeasureDefinition.thresholdRule.thresholdRuleSeveritySeverity level of the threshold rule.Valid values: - high - medium - low Data type: String
testMeasureDefinition.unitOfMeasureMeasurable value of time used to calculate the performance of a service in days, minutes, and seconds.Data type: String
testMeasureDefinition.validForDate range that the test measure definition is valid for.Data type: String
"validFor": {
 "endDateTime": "String",
 "startDateTime": "String"
}
testMeasureDefinition.validFor.endDateTimeValidity end date of the test measure definition. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
testMeasureDefinition.validFor.startDateTimeValidity start date of the test measure definition. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
validForDate range that the test definition is valid for.Data type: Object
"validFor": {
 "endDateTime": "String",
 "startDateTime": "String"
}
validFor.endDateTimeDate and time of the test definition on which the state of it is retired. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
validFor.startDateTimeDate and time of the test definition on which the state of it is published. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

HeaderDescription
AcceptData format of the response body. Only supports application/json.
Content-TypeData format of the request body. Only supports application/json.
HeaderDescription
Content-TypeData format of the response body. Only supports application/json.

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Status codeDescription
200Successful. The request was successfully processed.
400Bad Request. A bad request type or malformed request was detected.

Response body parameters (JSON or XML)

NameDescription
descriptionDescription of the service test definition.Data type: String
idSys\_id or external\_id of the service test definition.Data type: String Table: Service Test \[sn\_st\_mgmt\_test\]
nameName of the service test definition.Data type: String
relatedServiceSpecificationService specifications for the test definitions.Data type: Array of Objects
"relatedServiceSpecification": [
 {
  "id": "String",
  "name": "String"
 }
]
relatedServiceSpecification.idSys\_id or external\_id of the service specification.Data type: String Table: In the sys\_id or external\_id field of the Specification \[sn\_prd\_pm\_specification\] table.
relatedServiceSpecification.nameName of the service specification.Data type: String
serviceTestSpecRelationshipRelated service test definition.Data type: Array of Objects
"serviceTestSpecRelationship": [
 {
  "id": "String",
  "name": "String",
  "relationshipType": "String"
 }
]
serviceTestSpecRelationship.idSys\_id or external\_id of the related service test definition.Data type: String Table: Test Definition \[sn\_st\_mgmt\_test\_definition\]
serviceTestSpecRelationship.nameName of the related test definition.Data type: String
serviceTestSpecRelationship.relationshipTypeType of relationship.Accepted values: - dependency - exclusivity - substitution Data type: String
specCharacteristicTest definition characteristics.Data type: Array of Objects
"specCharacteristic": [
 {
  "characteristicValueSpecification": [Array],
  "description": "String",
  "name": "String",
  "validFor": {Object},
  "valueType": "String"
 }
]
specCharacteristic.characteristicValueSpecificationPossible values of the characteristic.Data type: Array of Objects
"characteristicValueSpecification": [
 {
  "value": "String"
 }
]
specCharacteristic.characteristicValueSpecification.valueValue of the characteristic.Data type: String
specCharacteristic.descriptionDescription of the characteristic.Data type: String
specCharacteristic.nameName of the characteristic.Data type: String
specCharacteristic.validForDate range the characteristic is valid for.Data type: Object
"validFor": {
  "endDateTime": "String",
  "startDateTime": "String"
}
specCharacteristic.validFor.endDateTimeEnd date of the characteristic. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
specCharacteristic.validFor.startDateTimeStart date of the characteristic. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
specCharacteristic.valueTypeType of characteristic value.- choice - date - date/time - duration - email - label - single line test - yes/no Data type: String
testMeasureDefinitionTest measure definitions for this service test definition. See Define test measure definitions for a service test for more infomation.Data type: Array of Objects
"testMeasureDefinition": [
 {
  "captureFrequency": "String",
  "captureMethod": "String",
  "capturePeriod": {Object},
  "id": "String",
  "metricDescription": "String",
  "metricName": "String",
  "name": "String",
  "unitOfMeasure": "String",
  "thresholdRule": [Array],
  "validFor": {Object},
  "valueType": "String"
 }
]
testMeasureDefinition.captureFrequencyFrequency at which to capture the metric. Valid values: - daily - monthly - none - once - weekly Data type: String
testMeasureDefinition.captureMethodMethod used to capture the metric.Valid values: - automatic: Automatically capture the metric. - manual: Manually capture the metric. - none: Don't capture the metric. Data type: String
testMeasureDefinition.capturePeriodDuration or period of the capture.Data type: Object
"capturePeriod": {
  "amount": Number,
  "units": "String"
}
testMeasureDefinition.capturePeriod.amountNumber of capture periods.Data type: Number
testMeasureDefinition.capturePeriod.unitsUnits of the period.Accepted values: - days - hours - minutes - seconds Data type: String
testMeasureDefinition.idSys\_id or external\_id of the Test Measure definitions.Data type: String Table: Test Measure definition \[sn\_st\_mgmt\_test\_measure\_definition\]
testMeasureDefinition.metricDescriptionBrief description of the metric.Data type: String
testMeasureDefinition.metricNameUser-defined name of a metric in the test measure.Data type: String
testMeasureDefinition.nameName of the test measure definition.Data type: String
testMeasureDefinition.thresholdRuleRule that defines the condition \(raise or clear\) to achieve to apply consequences when a threshold is crossed or ceased to be crossed​ for a particular test measure definition.Data type: Array of Objects
{
  "thresholdRule": {
    "conformanceComparatorExact": Boolean,
    "conformanceComparatorLower": "String",
    "conformanceComparatorUpper": "String",
    "conformanceTargetExact": "String",
    "conformanceTargetLower": "String",
    "conformanceTargetUpper": "String",
    "consequence": [Array],
    "description": "String",
    "id": "String",
    "name": "String",
    "numberOfAllowedCrossing": Number,
    "thresholdRuleSeverity": "String",
    "tolerancePeriod": Object
  }
}
testMeasureDefinition.thresholdRule.conformanceComparatorExact

Flag that indicates whether a value is identical to the value of conformanceTargetExact.Valid values:

  • true: The value is identical to the value of conformanceTargetExact.
  • false: The value isn't identical conformanceTargetExact.

Data type: Boolean

Default: false

testMeasureDefinition.thresholdRule.conformanceComparatorLowerOperator that checks if a value falls below the threshold. Valid values: - greater than - is Data type: String
testMeasureDefinition.thresholdRule.conformanceComparatorUpperOperator that checks if a value exceeds the threshold.Valid values: - lesser than - is Data type: String
testMeasureDefinition.thresholdRule.conformanceTargetExactRequired if conformanceComparatorExact is set to true. If the conformanceComparatorExact value is set to true, its value matches the value defined in conformanceTargetExact.Data type: Number
testMeasureDefinition.thresholdRule.conformanceTargetLowerLower threshold value for comparing the test measure results.Data type: Number
testMeasureDefinition.thresholdRule.conformanceTargetUpperUpper threshold value for comparing the test measure results.Data type: Number
testMeasureDefinition.thresholdRule.consequenceAction \(prescribed action or notification\) to take when a threshold rule is crossed.Data type: Array of Objects
"consequence": [
 {
  "description": "String",
  "id": "String",
  "name": "String",
  "prescribeAction": "String",
  "repeatAction": Boolean,
  "validFor": {
  "endDateTime": "String",
  "startDateTime": "String"
 }
]
testMeasureDefinition.thresholdRule.consequence.descriptionDescription of the consequence. Data type: String
testMeasureDefinition.thresholdRule.consequence.idSys\_id or external\_id of the measure consequence.Data type: String
testMeasureDefinition.thresholdRule.consequence.nameName of the consequence.Data type: String
testMeasureDefinition.thresholdRule.consequence.prescribeActionUser-defined action to take for threshold violations. Actions vary between instances.Data type: String
testMeasureDefinition.thresholdRule.consequence.repeatActionFlag that indicates whether to repeat the applied action or not.Valid values: - true: Repeats the action. - false: Doesn't repeat the action. Data type: Boolean Default: false
testMeasureDefinition.thresholdRule.consequence.validForDate range that the consequence is valid for.Data type: Object
"validFor": {
 "startDateTime": "String",
 "endDateTime ": "String"
}
testMeasureDefinition.thresholdRule.consequence.validFor.endDateTimeValidity end date of the consequence. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
testMeasureDefinition.thresholdRule.consequence.validFor.startDateTimeValidity start date of the consequence. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
testMeasureDefinition.thresholdRule.descriptionDescription of the threshold rule.Data type: String
testMeasureDefinition.thresholdRule.idSys\_id or external\_id of the threshold rules.Data type: String Table: Threshold Rules \[sn\_st\_mgmt\_threshold\_rule\]
testMeasureDefinition.thresholdRule.nameName of the threshold rule.Data type: String
testMeasureDefinition.thresholdRule.numberOfAllowedCrossingMaximum crossings allowed within the tolerance period before consequences are applied.Data type: Number Maximum value: 40
testMeasureDefinition.thresholdRule.thresholdRuleSeveritySeverity of the threshold rule.Valid values: - high - low - medium Data type: String
testMeasureDefinition.unitOfMeasureMeasurable value of time used to calculate the performance of a service in days, minutes, and seconds.Data type: String
testMeasureDefinition.validForDate range the test measure definition is valid for.Data type: Object
"validFor": {
 "endDateTime": "String",
 "startDateTime": "String"
}
testMeasureDefinition.validFor.endDateTimeValidity end date of the test measure definition. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
testMeasureDefinition.validFor.startDateTimeValidity start date of the test measure definition. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
validForDate range the service test is valid for.Data type: Object
"validFor": {
 "endDateTime ": "String",
 "startDateTime": "String"
}
validFor.endDateTimeEnd date and time of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.
validFor.startDateTimeStart date and time of the service test. Data type: String Format: YYYY-MM-DD 00:00:00. For example, `2025-01-31 09:35:43`.

cURL request

The following example creates a new service test definition.

curl "https:/instance.servicenow.com/api/sn_sprb_mgmt/servicetestmanagement/serviceTestSpecification" \
--request POST \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--user 'username':'password'
-- data {
  "description": "Upstream and Downstream speed ",
  "name": "Speed Test",
  "validFor": {
    "startDateTime": "2024-05-31",
    "endDateTime": "2024-06-27"
  },
  "testMeasureDefinition": [
    {
      "id": "1a04f560432a02104fefe4511fb8f2ad",
      "captureFrequency": "once",
      "captureMethod": "automatic",
      "metricDescription": "This is the downstream speed in a service",
      "metricName": "Downstream Speed",
      "name": "Downstream Speed",
      "unitOfMeasure": "a second",
      "valueType": "",
      "capturePeriod": "30 Minutes",
      "validFor": {
        "startDateTime": "2024-05-30 08:49:26",
        "endDateTime": "2024-05-31 08:49:29"
      },
      "thresholdRule": [
        {
          "id": "a754f960432a02104fefe4511fb8f2d0",
          "description": "This speed is greater than the target upper",
          "name": "InternetSpeedValue",
          "numberOfAllowedCrossing": "0",
          "thresholdRuleSeverity": "high",
          "tolerancePeriod": "15 Minutes",
          "conformanceTargetLower": "75",
          "conformanceComparatorLower": "greater than",
          "consequence": [
            {
              "id": "15a4bd60432a02104fefe4511fb8f2b8",
              "prescribeAction": "null",
              "description": "generate a waring report",
              "name": "degradedQualityOfService",
              "repeatAction": "0",
              "validFor": {
                "startDateTime": "2024-05-30 08:51:29",
                "endDateTime": "2024-08-06 08:51:31"
              }
            },
            {
              "id": "e6847d60432a02104fefe4511fb8f2c3",
              "prescribeAction": "null",
              "description": "send a warning to the system",
              "name": "packetdrop",
              "repeatAction": "0",
              "validFor": {
                "startDateTime": "2024-05-30 08:50:53",
                "endDateTime": "2024-08-06 08:50:55"
              }
            }
          ]
        },
        {
          "id": "cb55b5a0432a02104fefe4511fb8f201",
          "description": "",
          "name": "InternetSpeedValue",
          "numberOfAllowedCrossing": "0",
          "thresholdRuleSeverity": "medium",
          "tolerancePeriod": "",
          "conformanceTargetUpper": "120",
          "conformanceComparatorUpper": "less than",
          "consequence": []
        }
      ]
    },
    {
      "id": "8f987524432a02104fefe4511fb8f2f0",
      "captureFrequency": "once",
      "captureMethod": "automatic",
      "metricDescription": "This is the upstream speed in the service",
      "metricName": "Upstream Speed",
      "name": "Upstream Speed",
      "unitOfMeasure": "a second",
      "valueType": "",
      "capturePeriod": "",
      "validFor": {
        "startDateTime": "",
        "endDateTime": ""
      },
      "thresholdRule": []
    }
  ],
  "specCharacteristic": [
    {
      "name": "restart",
      "description": "restart",
      "valueType": "yes_no",
      "validFor": {
        "startDatetime": "2024-05-30 08:45:49"
      },
      "characteristicValueSpecification": [
        {
          "value": "No",
        },
        {
          "value": "Yes",
        }
      ]
    }
  ],
  "serviceTestSpecRelationship": [
    {
      "id": "76a3b160432a02104fefe4511fb8f2ad",
      "name": "OAM Test",
      "relationshipType": ""
    }
  ],
  "relatedServiceSpecification": [
    {
      "id": "aeddcd1fb7d69910ff00f203ae11a990",
      "name": "Home Internet"
    }
  ]
}

Response body.

{
  "description": "Upstream and Downstream speed ",  
  "name": "Speed Test",
  "validFor": {
    "startDateTime": "2024-05-31",
    "endDateTime": "2024-06-27"
  },
  "testMeasureDefinition": [
    {
      "id": "1a04f560432a02104fefe4511fb8f2ad",
      "captureFrequency": "once",
      "captureMethod": "automatic",
      "metricDescription": "This is the downstream speed in a service",
      "metricName": "Downstream Speed",
      "name": "Downstream Speed",
      "unitOfMeasure": "a second",
      "valueType": "",
      "capturePeriod": "30 Minutes",
      "validFor": {
        "startDateTime": "2024-05-30 08:49:26",
        "endDateTime": "2024-05-31 08:49:29"
      },
      "thresholdRule": [
        {
          "id": "a754f960432a02104fefe4511fb8f2d0",
          "description": "This speed is greater than the target upper",
          "name": "InternetSpeedValue",
          "numberOfAllowedCrossing": "0",
          "thresholdRuleSeverity": "high",
          "tolerancePeriod": "15 Minutes",
          "conformanceTargetLower": "75",
          "conformanceComparatorLower": "greater than",
          "consequence": [
            {
              "id": "15a4bd60432a02104fefe4511fb8f2b8",
              "prescribeAction": "null",
              "description": "generate a waring report",
              "name": "degradedQualityOfService",
              "repeatAction": "0",
              "validFor": {
                "startDateTime": "2024-05-30 08:51:29",
                "endDateTime": "2024-08-06 08:51:31"
              }
            },
            {
              "id": "e6847d60432a02104fefe4511fb8f2c3",
              "prescribeAction": "null",
              "description": "send a warning to the system",
              "name": "packetdrop",
              "repeatAction": "0",
              "validFor": {
                "startDateTime": "2024-05-30 08:50:53",
                "endDateTime": "2024-08-06 08:50:55"
              }
            }
          ]
        },
        {
          "id": "cb55b5a0432a02104fefe4511fb8f201",
          "description": "",
          "name": "InternetSpeedValue",
          "numberOfAllowedCrossing": "0",
          "thresholdRuleSeverity": "medium",
          "tolerancePeriod": "",
          "conformanceTargetUpper": "120",
          "conformanceComparatorUpper": "less than",
          "consequence": []
        }
      ]
    },
    {
      "id": "8f987524432a02104fefe4511fb8f2f0",
      "captureFrequency": "once",
      "captureMethod": "automatic",
      "metricDescription": "This is the upstream speed in the service",
      "metricName": "Upstream Speed",
      "name": "Upstream Speed",
      "unitOfMeasure": "a second",
      "valueType": "",
      "capturePeriod": "",
      "validFor": {
        "startDateTime": "",
        "endDateTime": ""
      },
      "thresholdRule": []
    }
  ],
  "specCharacteristic": [
    {
      "name": "restart",
      "description": "restart",
      "valueType": "yes_no",
      "validFor": {
        "startDatetime": "2024-05-30 08:45:49"
      },
      "characteristicValueSpecification": [
        {
          "value": "No",
          "validFor": {
            "startDateTime": "",
            "endDateTime": ""
          }
        },
        {
          "value": "Yes",
          "validFor": {
            "startDateTime": "",
            "endDateTime": ""
          }
        }
      ]
    }
  ],
  "serviceTestSpecRelationship": [
    {
      "id": "76a3b160432a02104fefe4511fb8f2ad",
      "name": "OAM Test",
      "relationshipType": ""
    }
  ],
  "relatedServiceSpecification": [
    {
      "id": "aeddcd1fb7d69910ff00f203ae11a990",
      "name": "Home Internet"
    }
  ]
  "id": "89d2b920432a02104fefe4511fb8f22e"
}