Skip to content

Commit 9605750

Browse files
authored
Update readme.md
1 parent 139a6bb commit 9605750

File tree

1 file changed

+19
-1
lines changed
  • GlideRecord/Record Activity Collector

1 file changed

+19
-1
lines changed

GlideRecord/Record Activity Collector/readme.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,31 @@
1-
It might be a requirement when we need collect the activities from a ticket, which were recorded by the system. There is an OOTB available Processor, called NGListHistoryDirectProcessor, but it executes a Java code, and call it from the back-end can be complex. So this solution makes the activity collection simple.
1+
It might be a requirement when we need to collect the activities from a ticket, and report it to any purposes. There is an OOTB available Processor, called NGListHistoryDirectProcessor, but it executes a Java code, and call it from the back-end can be complex. So this solution makes the activity collection simple.
22

33
The feature can be used easily:
44

5+
``` Javascript
56
var tableName = "incident";
67
var recordSysId = "57af7aec73d423002728660c4cf6a71c";
78
var collector = new global.ActivityStreamCollector(tableName, recordSysId);
89
var activityObj = collector.getActivityEntries();
910
gs.info(JSON.stringify(activityObj));
11+
```
1012

1113
The result will be a JSON array, which contains the history of record like it can be seen on the form:
1214

15+
``` JSON
1316
[
17+
{
18+
"createdBy": "System Administrator",
19+
"createdOn": "2023-10-17 17:28:14",
20+
"type": "field_changes",
21+
"value": [
22+
{
23+
"label": "Incident state",
24+
"oldValue": "New",
25+
"newValue": "In Progress"
26+
}
27+
]
28+
},
1429
{
1530
"createdBy": "System Administrator",
1631
"createdOn": "2023-10-17 17:05:18",
@@ -62,4 +77,7 @@ The result will be a JSON array, which contains the history of record like it ca
6277
]
6378
}
6479
]
80+
```
6581

82+
And finally the image below represents how the activity information looks like on the form:
83+
![activities](https://github.com/manrick/code-snippets/assets/29863465/345256f6-7e18-49b8-acc1-9e5d4c68131e)

0 commit comments

Comments
 (0)