|
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. |
2 | 2 |
|
3 | 3 | The feature can be used easily:
|
4 | 4 |
|
| 5 | +``` Javascript |
5 | 6 | var tableName = "incident";
|
6 | 7 | var recordSysId = "57af7aec73d423002728660c4cf6a71c";
|
7 | 8 | var collector = new global.ActivityStreamCollector(tableName, recordSysId);
|
8 | 9 | var activityObj = collector.getActivityEntries();
|
9 | 10 | gs.info(JSON.stringify(activityObj));
|
| 11 | +``` |
10 | 12 |
|
11 | 13 | The result will be a JSON array, which contains the history of record like it can be seen on the form:
|
12 | 14 |
|
| 15 | +``` JSON |
13 | 16 | [
|
| 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 | + }, |
14 | 29 | {
|
15 | 30 | "createdBy": "System Administrator",
|
16 | 31 | "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
|
62 | 77 | ]
|
63 | 78 | }
|
64 | 79 | ]
|
| 80 | +``` |
65 | 81 |
|
| 82 | +And finally the image below represents how the activity information looks like on the form: |
| 83 | + |
0 commit comments