jenkinsjenkins-pipelinejenkins-groovyreportportal

To Finish the launch created in the report portal from the Jenkins pipeline (Post build action)


I have used the curl command to finish the launch with the launch id from the report portal and tried executing in bash. To use this in jenkins pipeline.

It returns : % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0

Curl command:

curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer API_Token" http://xxx.xx.xxx.xxx/:8080/api/v1/launch/701/finish

does this work or anything needs to be changed in syntax.


Solution

  • There is dedicated API endpoint for finish: enter image description here

    This is an example of payload you would need to send:

    {
      "attributes": [
        {
          "key": "string",
          "system": false,
          "value": "string"
        }
      ],
      "description": "string",
      "endTime": "2024-03-09T15:55:01.427Z",
      "status": "PASSED"
    }
    

    Not all of the fields are mandatory, please refer to Swagger/OpenAPI documentation that lives at http://xxx.xx.xxx.xxx:8080/ui/#api Please, notice the method is 'PUT'.