Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Hi there! This has been asked a few different ways but I can't find a specific example of what I'm trying to achieve.
I'm looking to manage a HR process within Confluence pages (all contained within a single space).
To do this, I need to create ~220 individual pages (from a Template) with employee names added into the titles.
As part of this, I need to manage permissions on the page, only granting access to the employee, manager and exec for each business line.
The outcome would be a page for each employee in this process, with restricted access to the three relevant people (those people would be different for each page created).
I'm looking for a way to automate this process, rather than manually creating all the pages. Does anyone know of a solution for this?
Thank you for any help you can give me!
Hello @Dave Keating. You could accomplish what you want using ScriptRunner for Confluence. It should be possible to fully automate this.
You would need to write an inital custom script which you would run in ScriptRunner's Script Console. This will take care of your current users and create pages for them.
Then after, if you want to automate future creation of pages, you could write an Event Listener that would get triggered every time a new user is created and create a page for them.
To say a bit more, we have an example in our documentation on how to create a page whenever a new user is created:
https://scriptrunner.adaptavist.com/latest/confluence/listeners.html#_create_page_when_user_created
You could adapt that script to perform the "loop through all existing users and create a page" script that Roland mentioned, above. We have an example of another script that loops through all Confluence users to deactivate inactive ones, which may be helpful. https://library.adaptavist.com/entity/deactivate-inactive-users-in-confluence
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for this answer! I'm waiting to onboard all users to I can create the page and set the permissions in one hit. Will reply back with process and results once I have done it. Thank you again!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dave Keating as @Ste Wright mentioned you can use the Bob Swift Confluence Command Line Interface to do this without scripting.
Briefly - assuming you have the list of employees in a CSV file named "employees.csv" with employee, manager and exec columns for each business line and the template page is somewhere on the same Confluence instance you can do something like this:
Create pages from template:
Using runFromCsv | copyPage
acli --action runFromCSV --file "employees.csv" --common "--action copyPage --space \"TEMPLATE\" --title \"Template Page\" --newSpace \"HR\" --replaceTitle \"@employee@\" "
Set page permissions for employee:
Using runFromCsv | addPermissions
acli --action runFromCSV --file "employees.csv" --common "--action addPermissions --space \"HR\" --title \"@employee\" --permissions \"View\" --userId \"@employee@\" "
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't know a native way of doing this - you might need to consider an app which can help you drive some automation around page creation & restrictions.
For example, you could look into:
All of these have some levels of automation related to the areas you mentioned! Or you could check-out what else is on offer on the Marketplace :)
Ste
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.