---
sourceDocument: Australia IT Service Management
sourceDocumentLink: https://www.servicenow.com/docs/r/australia/it-service-management

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia IT Service Management

ft:clusterId :

    - itsm

bundleId :

    - itsm

workflow :

    - Technology


---

# Add test results to change requests using test API

# Add test results to change requests using test API {#ariaid-title1}

Release version: Australia  
Updated March 12, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 5 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of Add test results to change requests using test API

This feature enables ServiceNow customers to add test results directly to DevOps change requests via the DevOps - POST /devops/tool/{capability} API.
It supports all test types from multiple orchestration tools integrated with DevOps Change Velocity, facilitating automated and consistent reporting of test outcomes within change management workflows.
Show full answer Show less  

## Prerequisites

* Role required: **sndevops.admin**.
* The test type used in the API must exist and be mapped to the relevant orchestration tool in DevOps Change Velocity. This is managed via: *DevOps Change Workspace \> Administration \> Integrations \> Test types* and *Test type mappings*.
* For custom test types, create and save the new test type and mapping accordingly.

## Using the API with Azure DevOps, GitHub, and Jenkins

The API requires specifying the **toolId** (connected orchestration tool ID) and **testType** (mapped test type) as URL query parameters. The request body varies depending on the test type (performance tests, functional tests, unit tests) and must include relevant test metrics and metadata such as test name, duration, results counts, timestamps, build numbers, pipeline and stage names.

### Azure DevOps

* Use the URL suffix format: `/api/sndevops/v1/devops/tool/test?toolId=<devopsToolID>&testType=<testtype>`.
* Authentication uses a generic connection with username `devops.integration.user` and password.
* Example JSON bodies are provided for performance tests (including metrics like maximum virtual users, throughput, times) and for functional/unit tests (including counts of passed, failed, skipped tests).
* The feature supports YAML pipeline integration with InvokeRESTAPI task to POST test results.

### GitHub

* Configure GitHub Actions workflows to POST test results using `curl` commands with appropriate JSON bodies reflecting the test summary.
* Includes examples for both performance and functional/unit test scenarios.
* Authentication is done via base64-encoded credentials for the `devops.integration.user`.

### Jenkins

* Jenkins pipelines can use scripted pipeline steps with the `httpRequest` plugin to POST test data.
* Sample scripted pipelines demonstrate sending performance test metrics and functional/unit test summaries.
* Authentication uses base64-encoded credentials in HTTP headers.

## Limitations

* The API does not handle waiting or polling logic for test completion.
* Re-running test scenarios and managing those results are not supported by this API.

## Practical Benefits for ServiceNow Customers

* Automates the integration of test results into change requests, enhancing traceability and governance of software changes.
* Supports multiple popular CI/CD tools (Azure DevOps, GitHub, Jenkins), allowing seamless incorporation into existing pipelines.
* Enables detailed test metrics and summaries to be stored and visible within ServiceNow, improving visibility into test quality and change readiness.  
Add test results to DevOps change requests using the test capability of the DevOps - POST /devops/tool/{capability} API. The API is available for all test types for various tools connected to DevOps Change Velocity.
For more information about the API, see [DevOps - POST /devops/tool/{capability}](https://www.servicenow.com/docs/access?context=devops-api&version=australia&pubname=australia-api-reference&section=devops-POST-tool&ft:locale=en-US). To use the API in Azure DevOps, GitHub, and Jenkins, you must use the format mentioned in the respective sections below.
Prerequisites

Role required: sn_devops.admin

Make sure that the test type you want to use in the API is available as a test type in DevOps Change Velocity and mapped to the respective orchestration tool.  
1. Navigate to DevOps Change WorkspaceAdministrationIntegrationsTest types.

   You can also use the classic UI navigation DevOpsIntegrationsTest Types.
2. Verify if the test type is available in the Test types table.

3. For custom test types, select New and add the test type to the list.  
   1. In the Test type field, enter a name for your test type.
   2. From the Test category list, select the category of your test type.
   3. Select Save.
   {#test-api-tools__ol_cv3_m5v_kbc}
4. Navigate to DevOps Change WorkspaceAdministrationIntegrationsTest type mappings.

   You can also use the classic UI navigation DevOpsIntegrationsTest Type Mappings.
5. Verify if the test type is mapped to your orchestration tool.

6. If the mapping is not available, then select New and create the mapping.  
   1. From the Test type list, select the test type that you want to map.
   2. From the Tool integration list, select your orchestration tool.
   3. Select Save.
   {#test-api-tools__ol_vty_hvv_kbc}
{#test-api-tools__ol_drl_ksv_kbc}

## Azure DevOps {#test-api-tools__section_q33_xyk_kbc}

For Azure DevOps pipelines, use the format given here to add test results to change requests for various test types.  
Format for URL suffix and parameters:

    /api/sn_devops/v1/devops/tool/test?toolId=<devops_ToolID>&testType=<test_type>

* The parameter toolId must be a valid Tool Id from a connected and configured tool in DevOps Change Velocity.
* The parameter testType should have a test type mapping in DevOps Change Velocity.
{#test-api-tools__ul_yps_xxm_lbc}

Within the Body, you must pass the parameters based on the test type.  
Note:  
For the generic connection, use the following:

* username: devops.integration.user
* password: \<devops.integration.user password\>
{#test-api-tools__ul_izs_yfg_mbc}

Pipeline configuration for performance tests  
Sample parameters for the body:

    {
      "name": "Perf. tests DEMO5",
      "duration": 0,
      "maximumVirtualUsers": 10,
      "throughput": "5/min",
      "maximumTime": 10000,
      "minimumTime": 5000,
      "averageTime": 7000,
      "ninetyPercent": 8000,
      "standardDeviation": 2,
    "startTime": "2023-12-14T23:31:31z",
      "finishTime": "2023-12-14T23:40:32z",
      "buildNumber": $(Build.BuildNumber),
      "stageName": "Test API Job",
      "pipelineName": "TEST-CI-PIPELINE"
    }

Performance test summary in your Now instance:

Test summary attached to your DevOps change request:

Pipeline configuration for other functional and unit tests  
Sample parameters for the body:

    {
      "name":" Smoke Test summary",
       "duration":0.0,
       "passedTests":1,
       "failedTests":1,
       "skippedTests":1,
       "blockedTests":1,
       "totalTests":4,
      "startTime": "2023-12-14T23:31:31z",
      "finishTime": "2023-12-15T23:31:31z",
      "buildNumber": $(Build. BuildNumber),
     "stageName": "Test API Job",
      "pipelineName": "TEST-CI-PIPELINE"
    }

Test summary attached to your DevOps change request:

## Azure DevOps YAML pipeline {#test-api-tools__section_qxh_x2l_kbc}

Sample pipeline:  

    stages:
      - stage: BashScript
        jobs:
          - job: 'bash'
            steps:
            - script: echo Hello, world!
              displayName: 'BashScript'

            
      - stage: TestAPI
        dependsOn: BashScript
        jobs:
          - job: 'RESTTestAPI'
            # dependsOn: BashScript
            pool: server
            steps:
            - task: InvokeRESTAPI@1
              displayName: 'Invoke REST API: POST'
              inputs:
                connectionType: 'connectedServiceName'
                serviceConnection: 'v01 - generic connection'
                method: 'POST'
                body: |
                  {
                                "name": "Performance test summary kl2",
                                "duration": 0,
                                "maximumVirtualUsers": 10,
                                "throughput": "5/min",
                                "maximumTime": 10000,
                                "minimumTime": 5000,
                                "averageTime": 7000,
                                "ninetyPercent": 8000,
                                "standardDeviation": 2,
                                "startTime": "2023-12-14T23:31:31z",
                                "finishTime": "2023-12-14T23:40:32z",
                                "buildNumber": $(Build.BuildId),
                                "stageName": "TestAPI/RestTestAPI",
                                "pipelineName": "TESTYMLPipeline"
                              }
                urlSuffix: '/api/sn_devops/v1/devops/tool/test?toolId=<devops_ToolID>&testType=<test_type>'
                waitForCompletion: 'false'

              
Release pipeline

## GitHub {#test-api-tools__section_agm_wyk_kbc}

For GitHub pipelines, use the format given here to add test results to change requests for various test types.

Pipeline configuration for performance tests

Sample pipeline:  

    name: Test API Call Perf

    on: 
      workflow_dispatch:

    jobs:
      post_api_call_perf:
        runs-on: ubuntu-latest
        
        steps:
        - name: Checkout Repository
          uses: actions/checkout@v2

        - name: post_api_call_perf
          run: |
            apiUrl="https://<your_instance>.service-now.com/api/sn_devops/v1/devops/tool/test?toolId=<devops_ToolId>&testType=<performance_test_type>"
            requestBody='{"toolId": "<devops_ToolId>", "buildNumber": '${{ github.run_number }}' , "workflow": "Test API Call Perf", "repository": "<your_GitHub_repository>", "stageName":"post_api_call_perf","pipelineName":"Test API Call Perf", "testType": "Load", "buildNumber": '${{ github.run_number }}', "buildId": '${{ github.run_id }}' , "attemptNumber" : '${{ github.run_attempt }}', "name": "GitHub Test Summary - Performance 1.0","duration": 0.0,"maximumVirtualUsers": 10,"throughput": "5/min","maximumTime": 1000,"minimumTime": 5000,"averageTime": 7000,"startTime": "2023-12-14T23:31:31z","finishTime": "2023-12-14T23:31:31z","ninetyPercent": 8000, "standardDeviation": 2.0 }'
            auth="devops.integration.user:<password> in base64 encoded"
            authHeader="Basic $auth"
            response=$(curl -X POST -H "Content-Type: application/json" -H "Authorization: $authHeader" -d "$requestBody" $apiUrl)
            exitCode=$?
            
            if [ $exitCode -eq 0 ]; then
              echo "API call successful!"
              echo "Response: $response"
            else
              echo "API call failed!"
              echo "Response: $response"
              exit 1
            fi

Pipeline configuration for other functional and unit tests  
Sample pipeline:

    name: Test API Call

    on: 
      workflow_dispatch:

    jobs:
      post_api_call:
        runs-on: ubuntu-latest
        
        steps:
        - name: Checkout Repository
          uses: actions/checkout@v2

        - name: post_api_call
          run: |
            apiUrl="https://<your_instance>.service-now.com/api/sn_devops/v1/devops/tool/test?toolId=<devops_ToolID>&testType=<test_type>"
            requestBody='{"toolId": "<devops_ToolID>", "buildNumber": '${{ github.run_number }}' , "workflow": "Test API Call", "repository": "<your_GitHub_repository>", "stageName":"post_api_call","pipelineName":"TestAPICall", "testType": "Smoke", "buildNumber": '${{ github.run_number }}', "buildId": '${{ github.run_id }}' , "attemptNumber" : '${{ github.run_attempt }}', "testSummaries": [{"name": "GitHub Test Summary - smoke","passedTests": 1,"failedTests": 1,"skippedTests": 1,"ignoredTests": 0,"blockedTests": 1,"totalTests": 4,"startTime": "2023-12-14T23:31:31z","endTime": "2023-12-14T23:31:31z","duration": 0.0,"testType": "Smoke", "suites": []}] }'
            auth="devops.integration.user:<password> in base64 encoded"
            
            authHeader="Basic $auth"
            response=$(curl -X POST -H "Content-Type: application/json" -H "Authorization: $authHeader" -d "$requestBody" $apiUrl)
            exitCode=$?
            
            if [ $exitCode -eq 0 ]; then
              echo "API call successful!"
              echo "Response: $response"
            else
              echo "API call failed!"
              echo "Response: $response"
              exit 1
            fi

## Jenkins {#test-api-tools__section_pfd_5yk_kbc}

For Jenkins pipelines, use the format given here to add test results to change requests for various test types.

Pipeline configuration for performance tests  
Sample pipeline:

    pipeline {
        agent any
        stages {
            stage('POST API Call') {
                steps {
                    script {
                        def apiUrl = 'https://<your_instance>.service-now.com/api/sn_devops/v1/devops/tool/test?toolId=<devops_ToolID>&testType=<performance_test_type>'
                        def requestBody = [
                            name: "Performance Load tests jenkins",
                            duration: 0.0,
                            maximumVirtualUsers: 10,
                            throughput: "6/min",
                            maximumTime: 1000,
                            minimumTime: 300,
                            averageTime: 700,
                            ninetyPercent: 600,
                            standardDeviation: 2.0,
                            startTime: "2023-12-14T23:31:31z",
                            finishTime: "2023-12-14T23:40:32z",
                            buildNumber: env.BUILD_NUMBER,
                            stageName: "POST API Call",
                            pipelineName: "KLPerformanceTestPipeline"
                        ]
                        def auth = "<password>" // devops.integration.user:<password> in base64 encoded.
                        def authHeader = "Basic " + auth
                        def response = httpRequest(
                            contentType: 'APPLICATION_JSON',
                            httpMode: 'POST',
                            requestBody: groovy.json.JsonOutput.toJson(requestBody),
                            url: apiUrl,
                            customHeaders: [[name: 'Authorization', value: authHeader]]
                        )

                        if (response.status == 200 || response.status == 201) {
                            echo "API call successful!"
                            echo "Response: ${response.content}"
                        } else {
                            error "API call failed with status ${response.status}"
                        }
                    }
                }
            }
        }
    }

Pipeline configuration for other functional and unit tests  
Sample pipeline:

    pipeline {
        agent any
        
        stages {
            stage('POST API Call') {
                steps {
                    script {
                        def apiUrl = 'https://<your_instance>.service-now.com/api/sn_devops/v1/devops/tool/test?toolId=<devops_ToolID>&testType=<test_type>'
                        def requestBody = [
                            name: "Smoke tests",
                            duration: 0.0,
                            passedTests: 1,
                            failedTests: 1,
                            skippedTests: 1,
                            blockedTests: 1,
                            totalTests: 4,
                            startTime: "2023-12-14T23:31:31z",
    	                    finishTime: "2023-12-15T23:31:31z",
                            buildNumber: env.BUILD_NUMBER,
                            stageName: "POST API Call",
                            pipelineName: "TestPipelineKL"
                        ]
                        
                        def auth = "<password>" // devops.integration.user:<password> in base64 encoded.
                        def authHeader = "Basic " + auth
                        
                        def response = httpRequest(
                            contentType: 'APPLICATION_JSON',
                            httpMode: 'POST',
                            requestBody: groovy.json.JsonOutput.toJson(requestBody),
                            url: apiUrl,
                            customHeaders: [[name: 'Authorization', value: authHeader]]
                        )
                        
                        if (response.status == 200 || response.status == 201) {
                            echo "API call successful!"
                            echo "Response: ${response.content}"
                        } else {
                            error "API call failed with status ${response.status}"
                        }
                    }
                }
            }
        }
    }

## Limitations of the test API {#test-api-tools__section_nym_dz4_kbc}

* Waiting logic will not be taken care of.
* Re-run scenarios cannot be handled.
{#test-api-tools__ul_g1r_2z4_kbc}

*[\>]: and then


