Skip to content

Commit e44d91b

Browse files
authored
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 3a77743 commit e44d91b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
(function executeStep(inputs, outputs, stepResult, timeout) {
22

3-
var recordSysId = inputs.u_sys_id;
3+
var recordSysId = inputs.u_sys_id; // It takes the sys_id of the incident
44

55
var finance = new GlideRecord("incident");
66
finance.addQuery("sys_id", recordSysId);
77
finance.query();
88
if (finance.next()) {
99
outputs.u_number = finance.getDisplayValue("number");
1010
outputs.u_short_description= finance.getDisplayValue("short_description");
11-
stepResult.setOutputMessage('Found the record');
12-
stepResult.setSuccess();
11+
stepResult.setOutputMessage('Found the record');
12+
stepResult.setSuccess(); // Setting the output message as successfull.
1313
} else {
1414
stepResult.setOutputMessage('Record not found');
15-
stepResult.setFailed();
15+
stepResult.setFailed(); // Setting the output message as unsuccessfull.
1616
}
1717

1818
}(inputs, outputs, stepResult, timeout));

0 commit comments

Comments
 (0)