@@ -94,8 +94,16 @@ private void sendBuildDataToQD(Run run, Result overallResult, String finalZipPat
9494 String jobName = run .getParent ().getFullName ();
9595 int buildNumber = run .getNumber ();
9696 long endTimeInMillis = run .getTimeInMillis ();
97+
98+ Jenkins jenkins = Jenkins .getInstanceOrNull ();
99+ String rootUrl = jenkins !=null ? jenkins .getRootUrl () : null ;
100+ String jobUrl = null ;
101+ if (rootUrl != null ) {
102+ jobUrl = rootUrl + run .getUrl ();
103+ }
104+
97105 Timestamp endTime = new Timestamp (endTimeInMillis );
98- PipelineResults pipelineResultsReqObj = new PipelineResults (buildNumber , pipelineDuration , overallResult .toString (), finalZipPath , jobName , endTime );
106+ PipelineResults pipelineResultsReqObj = new PipelineResults (buildNumber , pipelineDuration , overallResult .toString (), finalZipPath , jobName , endTime , jobUrl );
99107 ObjectMapper objectMapper = new ObjectMapper ();
100108 String jsonBody = objectMapper .writeValueAsString (pipelineResultsReqObj );
101109
@@ -292,6 +300,9 @@ class PipelineResults implements Serializable {
292300 @ JsonProperty ("buildDuration" )
293301 private Long buildDuration ;
294302
303+ @ JsonProperty ("jobUrl" )
304+ private String jobUrl ;
305+
295306 @ JsonProperty ("endTime" )
296307 private Timestamp endTime ;
297308 @ JsonProperty ("buildStatus" )
@@ -300,12 +311,13 @@ class PipelineResults implements Serializable {
300311 @ JsonProperty ("zipFile" )
301312 private String zipFile ;
302313
303- public PipelineResults (Integer buildNumber , Long buildDuration , String buildStatus , String zipFile , String pipelineName , Timestamp endTime ) {
314+ public PipelineResults (Integer buildNumber , Long buildDuration , String buildStatus , String zipFile , String pipelineName , Timestamp endTime , String jobUrl ) {
304315 this .buildNumber = buildNumber ;
305316 this .buildDuration = buildDuration ;
306317 this .buildStatus = buildStatus ;
307318 this .zipFile = zipFile ;
308319 this .pipelineName = pipelineName ;
309320 this .endTime = endTime ;
321+ this .jobUrl = jobUrl ;
310322 }
311323}
0 commit comments