diff --git a/vars/UpdateBuildFailureIssues.groovy b/vars/UpdateBuildFailureIssues.groovy index f685eb4a..e559a7ae 100644 --- a/vars/UpdateBuildFailureIssues.groovy +++ b/vars/UpdateBuildFailureIssues.groovy @@ -13,6 +13,9 @@ @param args.buildStartTimeFrom - Start time range to retrieve the documents. Defaults to 'now-6h' @param ags.buildStartTimeTo - End time range to retrieve the documents. Defaults to 'now' */ + +import jenkins.ComponentBuildStatus + void call(Map args = [:]) { lib = library(identifier: 'jenkins@main', retriever: legacySCM(scm)) def inputManifest = readYaml(file: args.inputManifestPath) @@ -33,9 +36,11 @@ void call(Map args = [:]) { def awsSecretKey = env.AWS_SECRET_ACCESS_KEY def awsSessionToken = env.AWS_SESSION_TOKEN def indexName = 'opensearch-distribution-build-results-*' + + def componentBuildStatus = new ComponentBuildStatus(metricsUrl, awsAccessKey, awsSecretKey, awsSessionToken, indexName, this) - passedComponents = new ComponentBuildStatus(metricsUrl, awsAccessKey, awsSecretKey, awsSessionToken, indexName, this).getComponents('passed') - failedComponents = new ComponentBuildStatus(metricsUrl, awsAccessKey, awsSecretKey, awsSessionToken, indexName, this).getComponents('failed') + passedComponents = componentBuildStatus.getComponents('passed') + failedComponents = componentBuildStatus.getComponents('failed') } }