Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supported to take single value as an array having the value. #27772

Merged
merged 1 commit into from Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions Packs/FiltersAndTransformers/ReleaseNotes/1_2_22.md
@@ -0,0 +1,7 @@

#### Scripts

##### MakePair

- Added support for a single value as an array having the defined value.
- Updated the Docker image to: *demisto/python3:3.10.12.63474*.
6 changes: 6 additions & 0 deletions Packs/FiltersAndTransformers/Scripts/MakePair/MakePair.py
Expand Up @@ -92,10 +92,16 @@ def main():
if array1_key := args.get('array1_key'):
array1 = [demisto_get(x, array1_key) for x in array1]

if not isinstance(array1, list):
array1 = [array1]

array2 = args.get('array2', [])
if array2_key := args.get('array2_key'):
array2 = [demisto_get(x, array2_key) for x in array2]

if not isinstance(array2, list):
array2 = [array2]

determine_output_length_by = args.get('determine_output_length_by', 'shorter')
if determine_output_length_by == 'array1':
diff = len(array1) - len(array2)
Expand Down
2 changes: 1 addition & 1 deletion Packs/FiltersAndTransformers/Scripts/MakePair/MakePair.yml
Expand Up @@ -48,7 +48,7 @@ args:
scripttarget: 0
subtype: python3
runonce: false
dockerimage: demisto/python3:3.10.11.56082
dockerimage: demisto/python3:3.10.12.63474
runas: DBotWeakRole
fromversion: 6.8.0
tests:
Expand Down
Expand Up @@ -585,5 +585,24 @@
"yyy": 2
}
]
},

{
"args": {
"value": 1,
"array1_key": null,
"array2": "abc",
"array2_key": null,
"output_name1": "x",
"output_name2": "y",
"determine_output_length_by": null,
"merge_dict": null
},
"result": [
{
"x": 1,
"y": "abc"
}
]
}
]
4 changes: 2 additions & 2 deletions Packs/FiltersAndTransformers/pack_metadata.json
Expand Up @@ -2,7 +2,7 @@
"name": "Filters And Transformers",
"description": "Frequently used filters and transformers pack.",
"support": "xsoar",
"currentVersion": "1.2.21",
"currentVersion": "1.2.22",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand All @@ -19,4 +19,4 @@
"marketplacev2",
"xpanse"
]
}
}