From fb7bc52e715a3929b885842ace45cd8bbafd12ce Mon Sep 17 00:00:00 2001 From: "michael.albinson" Date: Fri, 3 Oct 2025 10:17:47 -0400 Subject: [PATCH] Out-of-order return in snippet This would cause the output message of the step to not be set correctly in the success case --- Specialized Areas/ATF Steps/Count table records/script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Specialized Areas/ATF Steps/Count table records/script.js b/Specialized Areas/ATF Steps/Count table records/script.js index 0e99a9346f..624acb5cd6 100644 --- a/Specialized Areas/ATF Steps/Count table records/script.js +++ b/Specialized Areas/ATF Steps/Count table records/script.js @@ -3,9 +3,9 @@ var gr = new GlideAggregate('incident'); gr.addAggregate('COUNT'); gr._query(); - if (gr.next()) { - return gr.getAggregate('COUNT'); // pass the step + if (gr.next()) { stepResult.setOutputMessage("Successfully Calculated the Count"); + return gr.getAggregate('COUNT'); // pass the step } else { stepResult.setOutputMessage("Failed to Count"); return false; // fail the step