Skip to content

Commit

Permalink
Fixed an issue where some operators with path didn't work to nested… (
Browse files Browse the repository at this point in the history
#24523)

* Fixed an issue where some operators with `path` didn't work to nested… (#24497)

* Fixed an issue where some operators with `path` didn't work to nested arrays.

* Update Packs/CommunityCommonScripts/ReleaseNotes/1_0_7.md

* Update Packs/CommunityCommonScripts/ReleaseNotes/1_0_7.md

---------

Co-authored-by: Yaakov Praisler <59408745+yaakovpraisler@users.noreply.github.com>

* Update ExtFilter.yml

* Update 1_0_7.md

---------

Co-authored-by: Masahiko Inoue <54964121+spearmin10@users.noreply.github.com>
Co-authored-by: Yaakov Praisler <59408745+yaakovpraisler@users.noreply.github.com>
  • Loading branch information
3 people committed Feb 12, 2023
1 parent 07bd1e7 commit fb56c9e
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 4 deletions.
5 changes: 5 additions & 0 deletions Packs/CommunityCommonScripts/ReleaseNotes/1_0_7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

#### Scripts
##### ExtFilter
- Fixed an issue where some operators with the *path* argument didn't work to nested arrays.
- Updated the Docker image to: *demisto/python3:3.10.10.47713*.
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ def filter_value(
return self.filter_values(root, optype, conds, path)

conds = {optype: self.parse_conds_json(conds)}
if isinstance(root, dict):
if isinstance(root, (dict, list)):
return self.filter_with_expressions(root, conds, path, inlist)
else:
return None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ args:
scripttarget: 0
subtype: python3
runonce: false
dockerimage: demisto/python3:3.10.8.37753
dockerimage: demisto/python3:3.10.10.47713
runas: DBotWeakRole
fromversion: 5.0.0
tests:
Expand Down
1 change: 1 addition & 0 deletions Packs/CommunityCommonScripts/Scripts/ExtFilter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ You can make filters with comlex and combination conditions for the context data
| **Argument Name** | **Description** |
| --- | --- |
| value | The value to filter/transform. |
| path | Context path to which to filter |
| operator | The operation name to filter/transform. |
| filter | The filter. |
| ctx_demisto | Enable to access the context data |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8198,5 +8198,28 @@
"result": ["{xxx}"]
}
]
}, {
"path": "path",
"operation": "==",
"filter": "b",
"ctx_demisto": null,
"ctx_inputs": null,
"ctx_lists": null,
"ctx_incident": null,
"eval": [{
"value": [
[
{
"path": ["a", "b", "c"]
}
]
],
"result": [
{
"path": ["b"]
}
]
}
]
}
]
4 changes: 2 additions & 2 deletions Packs/CommunityCommonScripts/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Community Common Scripts",
"description": "A pack that contains community scripts",
"support": "community",
"currentVersion": "1.0.6",
"currentVersion": "1.0.7",
"author": "",
"url": "https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/bd-p/Cortex_XSOAR_Discussions",
"email": "",
Expand All @@ -22,4 +22,4 @@
"marketplacev2"
],
"githubUser": []
}
}

0 comments on commit fb56c9e

Please sign in to comment.