Skip to content

Commit 900e613

Browse files
anara123tkatzir
andauthored
hide trimevents arg (#22241)
* hide trimevents arg * fixed conflicts * Update Packs/CommonScripts/Scripts/SearchIncidentsV2/SearchIncidentsV2.py Co-authored-by: tkatzir <[email protected]> * update test * fix tests * fix release notes * reset release notes * add release note * fix docker image --------- Co-authored-by: tkatzir <[email protected]>
1 parent a85d317 commit 900e613

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#### Scripts
2+
##### SearchIncidentsV2
3+
- Updated the Docker image to: *demisto/python3:3.10.10.47713*.
4+
- Hid the trimevents argument. This argument is not supported in XSOAR.

Packs/CommonScripts/Scripts/SearchIncidentsV2/SearchIncidentsV2.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,13 @@ def search_incidents(args: Dict): # pragma: no cover
129129
to_date = todate.isoformat()
130130
args['todate'] = to_date
131131

132-
if args.get('trimevents') == '0':
133-
args.pop('trimevents')
132+
if args.get('trimevents'):
133+
platform = demisto.demistoVersion().get('platform', 'xsoar')
134+
if platform == 'xsoar' or platform == 'xsoar_hosted':
135+
raise ValueError('The trimevents argument is not supported in XSOAR.')
136+
137+
if args.get('trimevents') == '0':
138+
args.pop('trimevents')
134139

135140
platform = get_demisto_version().get('platform')
136141

Packs/CommonScripts/Scripts/SearchIncidentsV2/SearchIncidentsV2.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ args:
109109
name: trimevents
110110
required: false
111111
secret: false
112-
defaultValue: '0'
112+
hidden: true
113113
- default: false
114114
description: Number of incidents per page (per fetch)
115115
isArray: false
@@ -202,7 +202,7 @@ tags:
202202
- Utility
203203
timeout: '0'
204204
type: python
205-
dockerimage: demisto/python3:3.10.9.45313
205+
dockerimage: demisto/python3:3.10.10.47713
206206
fromversion: 5.0.0
207207
tests:
208208
- No tests (auto formatted)

Packs/CommonScripts/Scripts/SearchIncidentsV2/SearchIncidentsV2_test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ def test_filter_events(mocker, args, filtered_args, expected_result):
152152
"""
153153
import SearchIncidentsV2
154154
execute_mock = mocker.patch.object(SearchIncidentsV2, 'execute_command', side_effect=get_incidents_mock)
155+
if 'trimevents' in args:
156+
# trimevents supported only in XSIAM
157+
mocker.patch.object(demisto, 'demistoVersion', return_value={'platform': 'xsiam'})
158+
155159
_, res, _ = SearchIncidentsV2.search_incidents(args)
156160
assert res == expected_result
157161
assert execute_mock.call_count == 1

Packs/CommonScripts/pack_metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "Common Scripts",
33
"description": "Frequently used scripts pack.",
44
"support": "xsoar",
5-
"currentVersion": "1.11.22",
5+
"currentVersion": "1.11.23",
66
"author": "Cortex XSOAR",
77
"url": "https://www.paloaltonetworks.com/cortex",
88
"email": "",

0 commit comments

Comments
 (0)