Skip to content

Commit 7d4512f

Browse files
authored
Added Client Script (Redact Sensitive Information) (#1520)
* Create README.md * Create script.js
1 parent badabe4 commit 7d4512f

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Redact Sensitive Information
2+
3+
When users create an incident or HR case via the self-service portal, they may occasionally enter sensitive information (e.g., personal identifiers, account numbers).
4+
To prevent misuse of such data, **fulfillers** can redact sensitive information from the short description or description fields.
5+
6+
This ensures that confidential information is safeguarded and not accessible for unauthorized use or distribution.
7+
8+
## Prerequisites
9+
10+
1. Custom Field:
11+
Add a custom field to the form to hold the redacted text.
12+
Example: u_redact (Redact).
13+
14+
2. OnSubmit Client Script:
15+
Create an onsubmit client script to redact sensitive information.
16+
This script will update the **short description** and **description** field with custom value as required.
17+
18+
**Note**: Data that has been redacted cannot be recovered.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
function onSubmit() {
2+
var redact = g_form.getValue("u_redact"); //custom field on the form to redact information
3+
if (redact == true) {
4+
var answer = confirm(getMessage('Do you want to redact sensitive information')); //Confirm the user who wants to redact information
5+
if (answer) {
6+
g_form.setValue('short_description', 'Short Description is redacted as it contained sensitive information'); //Custom short_description post redacting
7+
g_form.setValue('description', 'Description is redacted as it contained sensitive information'); //Custom description post redacting
8+
g_form.setValue('work_notes', 'The Description and Short Description has been redacted.'); //Adding work notes to track who redacted the short_description and description
9+
g_form.setReadOnly('short_description', true);
10+
g_form.setReadOnly('description', true);
11+
g_form.setReadOnly('u_redact', true)
12+
} else {
13+
g_form.setValue('u_redact', false);
14+
return false;
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)