GenerateSummaryReports
Generate report summaries for the passed incidents.
- Type
- javascript
- Pack
- CommonScripts
Source
var res = [];
var ids = argToList(args.ids);
if(!Array.isArray(ids)) {
ids = [ids]; //single element case
}
ids = ids.filter(function(value, index, self) { // make sure array is unique
return self.indexOf(value) === index;
});
var ec = {SummaryReports: []};
ids.forEach(function(id) {
var reportEntries = executeCommand("generateSummaryReport", {name: args.name, type: args.type, incidentId: id});
res = res.concat(reportEntries);
if(reportEntries[0] && reportEntries[0].File) {
ec.SummaryReports.push({IncidentID: id, ReportName: args.name, File: reportEntries[0].File, FileID: reportEntries[0].FileID})
}
wait(1); //required to avoid generated file name conflicts
});
if(ec.SummaryReports.length > 0) {
res.push({
Type: entryTypes.note,
Contents: ec,
ContentsFormat: formats.json,
HumanReadable: tableToMarkdown("Summary Reports", ec.SummaryReports),
EntryContext: ec
});
}
return res;
README
Generates a report summary for past incidents.
Script Data
| Name |
Description |
| Script Type |
javascript |
| Tags |
Utility |
| Cortex XSOAR Version |
4.1.0+ |
Inputs
| Argument Name |
Description |
| name |
Template name of the generated report in the incident. |
| type |
The report type to generate. |
| ids |
The incident IDs for which to generate. |
Outputs
| Path |
Description |
Type |
| SummaryReports.IncidentID |
The incident ID of each generated report. |
number |
| SummaryReports.ReportName |
The report name. |
string |
| SummaryReports.File |
The file name of the report file. |
string |
| SummaryReports.FileID |
The file ID of the generated report. |
string |