From d510b755595a6de090c88184bbfe00984eafdff1 Mon Sep 17 00:00:00 2001 From: Abhishek Thakur <146176327+at8807602@users.noreply.github.com> Date: Thu, 2 Oct 2025 11:30:42 +0530 Subject: [PATCH 1/6] Create Get_Number_&_Short_Description Above custom test step configuration script will help to get the "Number" & "Short Description" based on the sys_id of the incident. Let's say while performing any server dependent steps on incident table this custom step configuration script can be very usefullt to retrieve the details, not only about incident or number, short_description. Anybody can utilize this script to create custom step configuration script on different usecases o scenario. Note: You need to define the inputs & outputs for this, in my case I have defined the 'sys_id' as an input and "Number" & "Short Description" as an output to store the values and use it anywhere. Also to make sure you define the "stepResult.setOutputMessage("Successfull")" and "stepResult.setOutputMessage("Unsuccessfull")" --- .../Get_Number_&_Short_Description | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Custom Test Step/Get_Number_&_Short_Description diff --git a/Custom Test Step/Get_Number_&_Short_Description b/Custom Test Step/Get_Number_&_Short_Description new file mode 100644 index 0000000000..ba5fd3c8fc --- /dev/null +++ b/Custom Test Step/Get_Number_&_Short_Description @@ -0,0 +1,18 @@ +(function executeStep(inputs, outputs, stepResult, timeout) { + + var recordSysId = inputs.u_sys_id; + + var finance = new GlideRecord("incident"); + finance.addQuery("sys_id", recordSysId); + finance.query(); + if (finance.next()) { + outputs.u_number = finance.getDisplayValue("number"); + outputs.u_short_description= finance.getDisplayValue("short_description"); + stepResult.setOutputMessage('Found the record'); + stepResult.setSuccess(); + } else { + stepResult.setOutputMessage('Record not found'); + stepResult.setFailed(); + } + +}(inputs, outputs, stepResult, timeout)); From 3a7774303748ee2d4bea8154e6d12df2be3000de Mon Sep 17 00:00:00 2001 From: Abhishek Thakur <146176327+at8807602@users.noreply.github.com> Date: Thu, 2 Oct 2025 11:31:09 +0530 Subject: [PATCH 2/6] Readme.md Above custom test step configuration script will help to get the "Number" & "Short Description" based on the sys_id of the incident. Let's say while performing any server dependent steps on incident table this custom step configuration script can be very usefullt to retrieve the details, not only about incident or number, short_description. Anybody can utilize this script to create custom step configuration script on different usecases o scenario. Note: You need to define the inputs & outputs for this, in my case I have defined the 'sys_id' as an input and "Number" & "Short Description" as an output to store the values and use it anywhere. Also to make sure you define the "stepResult.setOutputMessage("Successfull")" and "stepResult.setOutputMessage("Unsuccessfull")" --- Custom Test Step/Readme.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 Custom Test Step/Readme.md diff --git a/Custom Test Step/Readme.md b/Custom Test Step/Readme.md new file mode 100644 index 0000000000..3354b074ba --- /dev/null +++ b/Custom Test Step/Readme.md @@ -0,0 +1,3 @@ +Above custom test step configuration script will help to get the "Number" & "Short Description" based on the sys_id of the incident. Let's say while performing any server dependent steps on incident table this custom step configuration script can be very usefullt to retrieve the details, not only about incident or number, short_description. Anybody can utilize this script to create custom step configuration script on different usecases o scenario. + +Note: You need to define the inputs & outputs for this, in my case I have defined the 'sys_id' as an input and "Number" & "Short Description" as an output to store the values and use it anywhere. Also to make sure you define the "stepResult.setOutputMessage("Successfull")" and "stepResult.setOutputMessage("Unsuccessfull")" From e44d91b600431acfc5a16b455af9ed901080dfcf Mon Sep 17 00:00:00 2001 From: Abhishek Thakur <146176327+at8807602@users.noreply.github.com> Date: Thu, 2 Oct 2025 11:41:35 +0530 Subject: [PATCH 3/6] Get_Number_&_Short_Description Above custom test step configuration script will help to get the "Number" & "Short Description" based on the sys_id of the incident. Let's say while performing any server dependent steps on incident table this custom step configuration script can be very usefullt to retrieve the details, not only about incident or number, short_description. Anybody can utilize this script to create custom step configuration script on different usecases o scenario. Note: You need to define the inputs & outputs for this, in my case I have defined the 'sys_id' as an input and "Number" & "Short Description" as an output to store the values and use it anywhere. Also to make sure you define the "stepResult.setOutputMessage("Successfull")" and "stepResult.setOutputMessage("Unsuccessfull")" --- Custom Test Step/Get_Number_&_Short_Description | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Custom Test Step/Get_Number_&_Short_Description b/Custom Test Step/Get_Number_&_Short_Description index ba5fd3c8fc..64fda52163 100644 --- a/Custom Test Step/Get_Number_&_Short_Description +++ b/Custom Test Step/Get_Number_&_Short_Description @@ -1,6 +1,6 @@ (function executeStep(inputs, outputs, stepResult, timeout) { - var recordSysId = inputs.u_sys_id; + var recordSysId = inputs.u_sys_id; // It takes the sys_id of the incident var finance = new GlideRecord("incident"); finance.addQuery("sys_id", recordSysId); @@ -8,11 +8,11 @@ if (finance.next()) { outputs.u_number = finance.getDisplayValue("number"); outputs.u_short_description= finance.getDisplayValue("short_description"); - stepResult.setOutputMessage('Found the record'); - stepResult.setSuccess(); + stepResult.setOutputMessage('Found the record'); + stepResult.setSuccess(); // Setting the output message as successfull. } else { stepResult.setOutputMessage('Record not found'); - stepResult.setFailed(); + stepResult.setFailed(); // Setting the output message as unsuccessfull. } }(inputs, outputs, stepResult, timeout)); From 2ff6c3bc03d3a2c01272d4db18eeb5f74533f245 Mon Sep 17 00:00:00 2001 From: Abhishek Thakur <146176327+at8807602@users.noreply.github.com> Date: Thu, 2 Oct 2025 11:41:54 +0530 Subject: [PATCH 4/6] Update Readme.md Above custom test step configuration script will help to get the "Number" & "Short Description" based on the sys_id of the incident. Let's say while performing any server dependent steps on incident table this custom step configuration script can be very usefullt to retrieve the details, not only about incident or number, short_description. Anybody can utilize this script to create custom step configuration script on different usecases o scenario. Note: You need to define the inputs & outputs for this, in my case I have defined the 'sys_id' as an input and "Number" & "Short Description" as an output to store the values and use it anywhere. Also to make sure you define the "stepResult.setOutputMessage("Successfull")" and "stepResult.setOutputMessage("Unsuccessfull")" --- Custom Test Step/Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Custom Test Step/Readme.md b/Custom Test Step/Readme.md index 3354b074ba..39f7539d78 100644 --- a/Custom Test Step/Readme.md +++ b/Custom Test Step/Readme.md @@ -1,3 +1,3 @@ -Above custom test step configuration script will help to get the "Number" & "Short Description" based on the sys_id of the incident. Let's say while performing any server dependent steps on incident table this custom step configuration script can be very usefullt to retrieve the details, not only about incident or number, short_description. Anybody can utilize this script to create custom step configuration script on different usecases o scenario. +Above custom test step configuration script will help to get the "Number" & "Short Description" based on the sys_id of the incident. Let's say while performing any server dependent steps on incident table this custom step configuration script can be very usefullt to retrieve the details, not only about incident or number, short_description. Anybody can utilize this script to create custom step configuration script on different usecases or scenario. Note: You need to define the inputs & outputs for this, in my case I have defined the 'sys_id' as an input and "Number" & "Short Description" as an output to store the values and use it anywhere. Also to make sure you define the "stepResult.setOutputMessage("Successfull")" and "stepResult.setOutputMessage("Unsuccessfull")" From 8f0ba704794bde061e64c7ebbab0facda23d7912 Mon Sep 17 00:00:00 2001 From: Abhishek Thakur <146176327+at8807602@users.noreply.github.com> Date: Thu, 2 Oct 2025 11:44:15 +0530 Subject: [PATCH 5/6] Update Get_Number_&_Short_Description Add Custom Test Step Configuration Script to Fetch Number & Short Description --- Custom Test Step/Get_Number_&_Short_Description | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Custom Test Step/Get_Number_&_Short_Description b/Custom Test Step/Get_Number_&_Short_Description index 64fda52163..8c9c4ec119 100644 --- a/Custom Test Step/Get_Number_&_Short_Description +++ b/Custom Test Step/Get_Number_&_Short_Description @@ -3,7 +3,7 @@ var recordSysId = inputs.u_sys_id; // It takes the sys_id of the incident var finance = new GlideRecord("incident"); - finance.addQuery("sys_id", recordSysId); + finance.addQuery("sys_id", recordSysId); finance.query(); if (finance.next()) { outputs.u_number = finance.getDisplayValue("number"); From 84ec32366fce9739c74adb6a1187b0d92ccae65e Mon Sep 17 00:00:00 2001 From: Abhishek Thakur <146176327+at8807602@users.noreply.github.com> Date: Thu, 2 Oct 2025 11:44:31 +0530 Subject: [PATCH 6/6] Readme.md Add Custom Test Step Configuration Script to Fetch Number & Short Description --- Custom Test Step/Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Custom Test Step/Readme.md b/Custom Test Step/Readme.md index 39f7539d78..0a8417a47b 100644 --- a/Custom Test Step/Readme.md +++ b/Custom Test Step/Readme.md @@ -1,3 +1,3 @@ Above custom test step configuration script will help to get the "Number" & "Short Description" based on the sys_id of the incident. Let's say while performing any server dependent steps on incident table this custom step configuration script can be very usefullt to retrieve the details, not only about incident or number, short_description. Anybody can utilize this script to create custom step configuration script on different usecases or scenario. -Note: You need to define the inputs & outputs for this, in my case I have defined the 'sys_id' as an input and "Number" & "Short Description" as an output to store the values and use it anywhere. Also to make sure you define the "stepResult.setOutputMessage("Successfull")" and "stepResult.setOutputMessage("Unsuccessfull")" +Note: You need to define the inputs & outputs for this, in my case I have defined the 'sys_id' as an input and "Number" & "Short Description" as an output to store the values and use it anywhere. Also to make sure you define the "stepResult.setOutputMessage("Successfull")" and "stepResult.setOutputMessage("Unsuccessfull")".