How to list restricted parent pages in a space using Confluence Command Line Interface CLI
This article explains how to get the list of parent pages that have page restrictions in a space using the Confluence Command Line Interface app.
Instructions
Option 1
If you want to get the permission list of all the pages in a space, run the following CLI command using the getPermissionList action.
--action runFromPageList --space "spacename" --parent "Home" --common "--action getPermissionList --id @pageId@"Option 2
If you want to get the permission list of specific pages, first get the title of pages using the getPageList action. Edit the file based on your requirements, then run the getPermissionList action to get the permissions of the pages from the provided .CSV file.
Run the following getPageList action command to get all the parent pages in the space.
--action getPageList --space "spacename" --title "Home" --children --columns "3, title, space" --outputFormat 999 --file "pagelist.csv""Edit the pagelist.csv file from the CLI results to ensure that it contains the Title and Space details.
Run the getPermissionList command to get all the page permissions in the space. This provides only the list of pages that have restrictions. Pages without restrictions are not displayed.
--action runFromCsv --file pagelist.csv --continue --common "--action getPermissionList --file "permissionlist.csv" --append"Output of the command:
Using the action commands above, this fetches pages with restrictions. Those pages must be accessible to the user.
Ensure the file is updated with the Title and Space names accordingly.