Share this page

# Report results from a pipeline

The following flow demonstrates how to inject report results from a pipeline.

In this topic:

## Entity relationship diagram

We need to access the following entities for this flow, and understand the relationships between these entities.

The following shows the relations in the flow.

Entity | Relationships in this flow | Description of relationship | Reference / relationship fields
--- | --- | --- | ---
CI Server | Pipeline | Multiple pipelines can be defined for each CI server. | pipeline
CI Job | Pipeline | Jobs are associated with pipelines. Each pipeline can contain one or more jobs. | jobs
CI Job | CI Build | Jobs are associated with builds. Each build can contain one or more jobs. | ci_job

## Flow

For details, see Add automated test results and Automated test results API reference.

After authenticating, do the following:

1. Register the CI/CD server.

       POST .../api/shared_spaces/<space_id>/workspaces/<workspace_id>/ci_servers

       {
          "data": [{
       	"name": "My_CICD_Server",
       	"url": "http://<host>:<port>/<path>",
       	"server_type": "ci_server"

          }]

       }

2. Register a pipeline in the CI/CD server.

       POST .../api/shared_spaces/<space_id>/workspaces/<workspace_id>/pipelines

       {
          "data": [{

              "name": "Your pipeline name for display needs",
       	"server_ci_id": "internal CI ID",
       	"root_job_ci_id": "internal CI ID",
       	"jobs": [
       		{},
       		{},
       		…
       		],

       }

   Field | Description
   --- | ---
   name | Name of the pipeline for display purposes. Required, must be unique across the system (shared space).
   server_ci_id | Internal ID for the server. Required. Prerequisite: A CI server with this name must exist already.
   root_job_ci_id | Internal ID for the server's root job. Required.
   jobs | A list of jobs. Required. At least one job, the root job, must be specified.

3. Report build results.

       PUT .../api/shared_spaces/<space_id>/workspaces/<workspace_id>/analytics/ci/builds

       {
       	"serverCiId": "ci server instance id",
       	"jobCiId": "job ci id",
       	"buildCiId": "build_internal_ci_id",
       	"buildName": "build display name, usually a number",
       	"startTime": 1456679398786,
       	"duration": 120490,
       	"status": "finished",
       	"result": "success",
       	"parameters": […],
       	"causes": [
       		{…},
       		{…}
       		]
       }

Field | Description
--- | ---
serverCiId | ID for the server. Required.
jobCiId | ID for the job. Required.
buildCiId | Internal ID for the build. Required.
buildName | Display name for the build, usually a number. Optional. If not supplied, the default is the buildCiId value.
startTime | The start time of the job. Required.
duration | The duration for the job. Required.
status | The status of the job. If not supplied, the default is finished.
result | The result of the job. Required.
parameters | List of parameters. Optional.
causes | If not supplied the cause build is assumed to be the root build {…}, // .

## See also

- REST API calls
- Common flows and ER diagrams
- Failure results
- Add automated test results
- Automated test results API reference

https://admhelp.microfocus.com Software Delivery Management 8942
Tips to improve your search results... OpenText™ Software Delivery Management Help Center OpenText™ Software Delivery Management Help 26.3 All View Local Help Center View Online Help Center Version: