diff --git a/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer.java b/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer.java index 2cafffc5..d0a27e10 100644 --- a/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer.java +++ b/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer.java @@ -460,8 +460,14 @@ public FormValidation doCheckScanId(@QueryParameter String scanId, @RelativePath return FormValidation.validateRequired(scanId); } - public FormValidation doCheckExecutionId(@QueryParameter String executionId) { - return FormValidation.validateRequired(executionId); + public FormValidation doCheckExecutionId(@RelativePath("..") @QueryParameter String credentials, @AncestorInPath ItemGroup context, @QueryParameter String scanId, @QueryParameter String executionId) { + IAuthenticationProvider authProvider = new JenkinsAuthenticationProvider(credentials, context); + JSONArray executionDetails = new CloudScanServiceProvider(authProvider).getBaseScanDetails(scanId, authProvider); + if(executionDetails == null) { + return FormValidation.error(Messages.error_base_scan_empty_ui()); + } else { + return FormValidation.validateRequired(executionId); + } } public FormValidation doCheckPresenceId(@RelativePath("..") @QueryParameter String credentials, @AncestorInPath ItemGroup context, @QueryParameter String presenceId) { diff --git a/src/main/resources/com/hcl/appscan/jenkins/plugin/Messages.properties b/src/main/resources/com/hcl/appscan/jenkins/plugin/Messages.properties index 5b9e920d..e50164b3 100644 --- a/src/main/resources/com/hcl/appscan/jenkins/plugin/Messages.properties +++ b/src/main/resources/com/hcl/appscan/jenkins/plugin/Messages.properties @@ -54,6 +54,7 @@ error.invalid.scan.id.ui = Invalid scan ID or mismatch in scan type. error.invalid.scan.id.application.ui = App mismatch with scan ID. error.invalid.scan.id.git.repo.ui = Git repo scans are unsupported for SAST rescans. error.invalid.scan.id.rescan.allowed.ui = Rescan disabled or demo scans not allowed. +error.base.scan.empty.ui = Base scan list is empty. Please enter valid Scan ID. analysis.running=Running security analysis...