Details
-
Fix
-
Status: Released (View Workflow)
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
Current Behavior:
- When exporting the inventory from the export view using "Export individual Object" with the "Handle recursively" option, the selected folders are not exported recursively
Steps to Reproduce:
- Create a nested folder structure in the Inventory as shown in the attached Folder_recursive.png.
- Export the inventory item from the root folder of the inventory by using "Export individual Object" with the "Handle recursively" option,
- Check the exported folder. The subfolders are missing from the exported folder.
Desired Behavior:
- When exporting the inventory from the export view using "Export individual Object" with the "Handle recursively" option, the selected folders should be exported recursively
When exporting inventory objects recursively the api endpoint should be used with the "recursive":true option for the items with "objectType":"FOLDER"
When the "Handle recursively" option is selected it is sufficient to call the endpoint for the folders on the upper level.
When one single item is deselected, then the parent folder will no longer be handled recursivly. Only the selected folders and items will be exported where the subfolders will be handled recursively.
Example:
Handle resursive: True
- /
- item1
- item2
- Folder1
- item3
- item4
- Folder2
- Folder3
- Folder4
Selecting the root folder will select all items and folders
Exporting this will result in a call that export / recursively (refer to the example below)
Deselecting item 2 will result in a call to export item1 and Folder1, Folder2, Folder3, Folder4 recursively (as done in the example below but with entries for Folder1..4 instead of /
Testing with a POST API call to /joc/api/inventory/export with the following JSON demonstrates that sub-folders are exported when "objectType": "FOLDER" and "recursive": true are specified:
{"useShortPath":false,"exportFile":\{"filename":"test.zip","format":"ZIP"},"shallowCopy":\{"withoutInvalid":false,"releasables":{"releasedConfigurations":[{"configuration":{"path":"/","objectType":"FOLDER","recursive":true}}],"draftConfigurations":[\{"configuration":{"path":"/","objectType":"FOLDER","recursive":true}}]},"deployables":\{"draftConfigurations":[{"configuration":{"path":"/","objectType":"FOLDER","recursive":true}}],"deployConfigurations":[\{"configuration":{"path":"/","objectType":"FOLDER","recursive":true}}]}}}