What is the purpose of this script?
Exhibit
Refer to the exhibit.
var gr = new GlideRecord('incident');
gr.addQuery('state', 1);
gr.query();
while (gr.next()) {
gs.log('Incident: ' + gr.number);
}Trap 1: Delete resolved incidents.
The script does not delete incidents; it only logs new incidents.
Trap 2: Update all open incidents.
The script does not update incidents; it only logs new incidents.
Trap 3: Count the number of incident records.
Incorrect. It does not count; it logs each record.
- A
Delete resolved incidents.
Why wrong: The script does not delete incidents; it only logs new incidents.
- B
Log all new incidents.
Correct. It logs incident numbers for state=1 (New).
- C
Update all open incidents.
Why wrong: The script does not update incidents; it only logs new incidents.
- D
Count the number of incident records.
Why wrong: Incorrect. It does not count; it logs each record.