Skip to content

Commit d510b75

Browse files
authored
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")"
1 parent 12c8338 commit d510b75

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
(function executeStep(inputs, outputs, stepResult, timeout) {
2+
3+
var recordSysId = inputs.u_sys_id;
4+
5+
var finance = new GlideRecord("incident");
6+
finance.addQuery("sys_id", recordSysId);
7+
finance.query();
8+
if (finance.next()) {
9+
outputs.u_number = finance.getDisplayValue("number");
10+
outputs.u_short_description= finance.getDisplayValue("short_description");
11+
stepResult.setOutputMessage('Found the record');
12+
stepResult.setSuccess();
13+
} else {
14+
stepResult.setOutputMessage('Record not found');
15+
stepResult.setFailed();
16+
}
17+
18+
}(inputs, outputs, stepResult, timeout));

0 commit comments

Comments
 (0)