-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautomation-DemistoUploadFileToIncident.yml
40 lines (39 loc) · 1.28 KB
/
automation-DemistoUploadFileToIncident.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
commonfields:
id: DemistoUploadFileToIncident
version: -1
name: DemistoUploadFileToIncident
script: |-
args = demisto.args()
incident_id = args.get('incident_id')
entry_id = args.get('entryID')
body = args.get('body', None)
response = demisto.executeCommand("demisto-api-multipart", {"uri":"incident/upload/{}".format(incident_id),"entryID":entry_id,"body":body})[0]
if isError(response):
demisto.results({ "Type" : entryTypes["error"], "ContentsFormat" : formats["text"], "Contents" : "There was an issue uploading file. Check API key and input arguments."})
else:
if body:
demisto.results("Successfully uploaded file to incident. Comment is:" + body)
else:
demisto.results("Successfully uploaded file to incident")
type: python
tags:
- DemistoAPI
comment: Copies a file from this incident to the specified incident. The file is uploaded
as an attachment to the specified incident’s Summary page, and recorded as an entry
in the War Room.
enabled: true
system: true
args:
- name: incident_id
required: true
description: ID of incident to upload to
- name: entryID
description: Entry ID of file to upload
- name: body
description: Request body
scripttarget: 0
dependson:
must:
- demisto-api-multipart
runonce: false
runas: DBotWeakRole