CreateFileFromPathObject
This automation is being executed by the "GetFilePathPreProcessing" pre-processing script that collects the paths and names of attachments of an incoming incident, then passes it to this automation that reads the files and creates them in an existing incident.
python · Community Common Scripts
Source
import demistomock as demisto # noqa: F401 from CommonServerPython import * # noqa: F401 obj = json.loads(demisto.args()["object"]) for attachment in obj: filePath = demisto.getFilePath(attachment["path"])["path"] with open(filePath, "rb") as f: data = f.read() demisto.results(fileResult(attachment["name"], data))
README
This automation is being executed by the “GetFilePathPreProcessing” pre-processing script that collects the paths and names of attachments of an incoming incident, then passes it to this automation that reads the files and creates them in an existing incident.
Script Data
| Name | Description |
|---|---|
| Script Type | python3 |
| Tags |
Inputs
| Argument Name | Description |
|---|---|
| object | path and name object passed by the “GetFilePathPreProcessing” pre-processing script |
Outputs
There are no outputs for this script.