Skip to content

Commit bdc8165

Browse files
authored
RestrictSystemCommentsOnTaskMetric.js
1 parent fb7b64d commit bdc8165

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//Table: Task Metric Reporting Table.
2+
//When to run:Before update
3+
//Conditions: Updated by is system
4+
5+
//Script
6+
(function executeRule(current, previous /null when async/ ) {
7+
8+
var caseSysid = current.u_task_number.sys_id;
9+
var grCase = new GlideRecord('sn_customerservice_case');
10+
if (grCase.get(caseSysid)) {
11+
var latestEntry = grCase.comments.getJournalEntry(1).toString();
12+
var latestWorknote = grCase.work_notes.getJournalEntry(1).toString();
13+
if (latestEntry.includes('System') || latestWorknote.includes('System')) {
14+
current.setAbortAction(true);
15+
}
16+
}

0 commit comments

Comments
 (0)