Skip to content

Commit 16a7d43

Browse files
authored
Create README.md
Created a README file
1 parent 23c19b3 commit 16a7d43

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

  • Client-Side Components/Client Scripts/Warn Before Closing Incident Without Work Notes
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Warn Before Closing Incident Without Work Notes
2+
3+
## Overview
4+
This Client Script prevents users from resolving or closing an Incident without adding work notes. It ensures that important resolution details are documented before the ticket is closed.
5+
6+
## Features
7+
- Triggered on form submission.
8+
- Checks if the Incident state is set to Resolved or Closed.
9+
- Displays a warning if Work Notes are empty.
10+
- Prevents form submission until notes are added.
11+
12+
## Configuration
13+
14+
- **Table**: `incident`
15+
- **Type**: `onSubmit`
16+
- **Script Name**: `Warn Before Closing Without Work Notes`
17+
- **Active**: `true`
18+
19+
## Script
20+
21+
22+
function onSubmit() {
23+
var state = g_form.getValue('state');
24+
var workNotes = g_form.getValue('work_notes');
25+
26+
if ((state == '6' || state == '7') && !workNotes.trim()) {
27+
alert("Please add work notes before resolving or closing the Incident.");
28+
return false;
29+
}
30+
31+
return true;
32+
}

0 commit comments

Comments
 (0)