In my project I need to create multiple (Approx 250) confluence pages having same template. We want to automate this process so that we can pass values in .csv file and those values will get populated in confluence page automatically. That .csv file will have header so values from 2nd row will get populated in 1st confluence page and values from 3rd row will get populated in 2nd confluence page and so on.
Kindly let me know if this is possible. If yes then how we can proceed for that.
If No then only manual page creation is possible?
Hi @Neeraj Kumar ,
as said by @Alex Koxaras _Relational_ it can't be put in place using builtin features. You need to develop something custom for that.
Fabio
Hi Fabio,
I totally agree that one need to develop customize code which might need to connect with different tools and features for this task.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Neeraj Kumar and welcome to the community,
Don't think that it is possible to import csv as pages in Confluence. You can use a word file to import a page, but not a csv.
The only workaround I can think of is to write a script which will call the confluence cloud rest api and then create the pages with populated content.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In order to populate the pages based on a template, you could also create a Jira automation rule, but you will not be able to update the page content. That you have to do it afterwards with your script.
Finally,
I haven't try the above solution, but it has good possibility of success.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alex,
Thanks for your prompt response.
I would like to go with solution of writing script and then calling confluence could rest API. It will be helpful if you can help in this approach like in which language I should write that script and how to link that with rest API of confluence cloud.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Neeraj Kumar ,
You can do such (and many more) automation using Power Scripts for Confluence. You can automate Confluence page creation by writing a script that reads data from a CSV file and creates pages based on its content. This can be achieved in a few simple steps. The script can be triggered manually using the SIL Manager and Run button, scheduled as a repeatable action, or set up with a Listener to trigger on specific events.
Power Scripts uses SIL scripting language, you can read more about it here.
And here is an example of such script based on your use case:
// Define the path to the CSV file
string csvFilePath = "confluence_pages.csv"; //path can be local or if you store that file in silprograms folder you don`t need extra permission to read it
// Define a structure to match the CSV columns. I assume my file csv has header with columns Page Title,Page Body
struct PageData {
string pageTitle;
string pageBody;
}
// Read the CSV file into an array of PageData structures
PageData[] pages = readFromCSVFile(csvFilePath, true);
// Iterate over the page records from csv and create Confluence pages
for (PageData page in pages) {
createPage("ABC", "", page.pageTitle, page.pageBody); //replace 1st parameter with Space Key
}
Here is the link to functions used in this script: readFromCSVFile , createPage ,arrayStructMap
Hope it helps! If you find my answer helpful, please do not forget to accept it :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Neeraj,
It sounds like you're looking for a streamlined way to create multiple Confluence pages from a CSV file. Instead of developing custom scripts, you might consider using an app like Pageify - Automate pages from Jira that automates the creation of Confluence pages directly from Jira.
Pageify can simplify this process by enabling dynamic content updates from issues, eliminating the need for manual scripting or complex API calls
This approach could save you significant time and effort in setting up and maintaining your documentation workflow
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.