Skip to content

Commit

Permalink
Supported to take single value as an array having the value. (#27646) (
Browse files Browse the repository at this point in the history
…#27772)

* Update .devcontainer.json name

* Update .devcontainer.json name

* Update .devcontainer.json name

* Update .devcontainer.json name

* Supported to take single value as an array having the value.

* Supported to take single value as an array having the value.

* Update docker image

* Update pack_metadata

* Update RN

---------

Co-authored-by: Masahiko Inoue <[email protected]>
Co-authored-by: spearmin10 <[email protected]>
  • Loading branch information
3 people authored Jun 28, 2023
1 parent f00689d commit a5dcd36
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
7 changes: 7 additions & 0 deletions Packs/FiltersAndTransformers/ReleaseNotes/1_2_22.md
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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"
]
}
}

0 comments on commit a5dcd36

Please sign in to comment.