forked from demisto/content
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript-TestCreateIncidents.yml
51 lines (48 loc) · 1.29 KB
/
script-TestCreateIncidents.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
41
42
43
44
45
46
47
48
49
50
51
commonfields:
id: TestCreateIncidents
version: -1
name: TestCreateIncidents
script: |-
NUMBER_OF_INCIDENTS = int(demisto.args()['numberOfIncidents'])
incident1_template = {
'type': 'Simulation',
'name': 'Tag1',
'details': 'This is a email bla bla bla',
}
incident2_template = {
'type': 'Simulation',
'name': 'Tag2',
'details': 'This2 is2 a2 email2 bla2 bla2 bla2',
}
for i in range(0, NUMBER_OF_INCIDENTS):
demisto.executeCommand("createNewIncident", incident1_template)
for i in range(0, NUMBER_OF_INCIDENTS):
demisto.executeCommand("createNewIncident", incident2_template)
demisto.results({
'Contents': 'Done crete incidents',
'ContentsFormat': formats['text'],
'EntryContext': {
'EmailSujbectKey': 'name',
'EmailBodyKey': 'details',
'EmailTagKey': 'name',
'IncidentsQuery': 'type:Simulation'
}
})
type: python
tags: []
enabled: true
args:
- name: numberOfIncidents
defaultValue: "2"
outputs:
- contextPath: EmailSujbectKey
description: EmailSujbectKey
- contextPath: EmailBodyKey
description: EmailBodyKey
- contextPath: EmailTagKey
description: EmailTagKey
- contextPath: IncidentsQuery
description: IncidentsQuery
scripttarget: 0
runonce: false
runas: DBotWeakRole