DemistoUploadFile Deprecated

Deprecated. Use UploadFileV2 instead.

javascript · Cortex REST API

Source

var res = executeCommand("core-api-multipart", {"uri":'entry/upload/' + args.incidentID,"entryID":args.entryID, "body":args.body});
if (isError(res[0])) {
    return res;
}
var entryId = dq(res,'Contents.response.entries.id');

var md = 'File uploaded successfully. Entry ID is ' + entryId;
if (args.body){
    md +=  '. Comment is:' + args.body;
}

return {
    ContentsFormat: formats.json,
    Type: entryTypes.note,
    Contents: res,
    HumanReadable: md
};

README

Copies a file from an incident to a specified incident. The file is recorded as an entry in the specified incident’s War Room.

Script Data


Name Description
Script Type javascript
Tags DemistoAPI

Dependencies


This script uses the following commands and scripts.

  • core-api-multipart

Inputs


Argument Name Description
entryID The file entry ID.
incidentID The incident ID to upload the file to.
body Request body

Outputs


There are no outputs for this script.