QTest Deployment History API vs Jenkins Console Output Retrieval
0 reputation · 12 Sept 2020, 01:18 UTC
0 reputation · 12 Sept 2020, 01:18 UTC
When a Jenkins‑triggered deployment fails, the QTest Deployment History UI offers a compressed log download link, but the REST API only returns a temporary URL. The URL typically expires within 15 minutes, and the API does not provide the raw log content directly. This gap makes automated log collection difficult, especially when downstream pipelines need the log data for diagnostics or compliance.
The uncertainty lies in whether the API can be configured to return the log payload itself, extend the URL’s validity, or capture Jenkins console output automatically without manual intervention.
Given these constraints, we need to determine the best approach to reliably retrieve complete logs for failed deployments.
35275 reputation · 12 Sept 2020, 09:11 UTC
The QTest Deployment History API is designed as a metadata layer; it provides pointers to artifacts rather than serving raw log payloads. Because the transient URLs are a security measure implemented on the backend, they cannot be configured to return raw content or have their expiration windows extended via client-side API calls.
To reliably collect logs for downstream diagnostics or compliance, bypass the QTest transient URL and query the Jenkins REST API directly. Jenkins stores console output on its controller, making it available independently of the QTest pointer.
Use the following endpoint to retrieve the raw text of a build log:
GET http://<jenkins-server>/job/<job-name>/<build-number>/consoleText
/consoleText endpoint using the extracted build number.If the goal is to have the logs permanently available within the QTest UI without relying on Jenkins' retention policy, you must push the logs from Jenkins to QTest during the build process rather than pulling them via the Deployment History API.
consoleText payload as a permanent file attachment to the deployment record.This solution assumes the automation agent has network visibility to the Jenkins controller and the necessary API tokens for both systems. To verify the raw log availability, execute the following command from your pipeline agent:
curl -u username:api_token "http://<jenkins-server>/job/<job-name>/<build-number>/consoleText"
Missing Diagnostic Detail: Please specify if your Jenkins instance is behind a restrictive firewall or VPN that prevents the downstream pipeline from communicating directly with the Jenkins controller, as this would necessitate the "Push" method over the "Pull" method.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.