Skip to content

Commit 0391aa1

Browse files
authored
Track tag removal using delete business rule (#1805)
* Create script.js * Delete Background scripts directory * Create Convert comma separated values in string to columns * Delete Convert comma separated values in string to columns * Create MID Server availability inside MID cluster.js * Create reame.md * Update MID Server availability inside MID cluster.js * Delete Flow Actions/Check MID Servers status inside MID Server cluster directory * Create BusinessRule.js * Delete Server-Side Components/Business Rules/BusinessRule.js * Create BusinessRule.js * Create readme.md
1 parent 2fca83b commit 0391aa1

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
(function executeRule(current, previous /*null when async*/ ) {
2+
/*
3+
Fire this BR when a tag is removed/deleted from a record.
4+
Retrieve the tag name, the user who removed the tag, and the tag removal date.
5+
Update the above information onto the tag-referenced record in this example, In this example its incident record
6+
*/
7+
var updateRecord = new GlideRecord(current.table);
8+
if (updateRecord.get(current.table_key)) {
9+
var notes = "Tag Name:" + " " + current.label.getDisplayValue() + "\n" + "Tag Removed By:" + " " + current.sys_updated_by + "\n" + "Tag Removed On:" + " " + current.sys_updated_on;
10+
//updateRecord.setValue("work_notes", notes);
11+
updateRecord.work_notes = notes;
12+
updateRecord.update();
13+
}
14+
})(current, previous);
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
**Configure the following business rule on the label_entry table:**
2+
3+
1.Ensure the "Delete" operation is selected and the rule runs onBefore.
4+
5+
2.Retrieve the table name where the tag is removed.
6+
7+
3.Update the worknotes to track who removed the tag and when it was removed.
8+
<img width="952" height="460" alt="image" src="https://github.com/user-attachments/assets/020525dc-c98d-4ae8-94f9-d77cca6680e7" />
9+
<img width="1665" height="739" alt="image" src="https://github.com/user-attachments/assets/46c930eb-c031-4e1e-b1e6-31a3c64debb0" />
10+
11+
12+
**Output:**
13+
14+
<img width="1139" height="818" alt="image" src="https://github.com/user-attachments/assets/ed07f380-f279-4eca-82a5-208ae54054e7" />
15+
16+
<img width="780" height="401" alt="image" src="https://github.com/user-attachments/assets/283b40e1-1d7c-42aa-85f8-b8e9c6ccc3d0" />
17+

0 commit comments

Comments
 (0)