Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Need help with automating confluence page creation

Neeraj Kumar January 19, 2023

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?

4 answers

1 vote
Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 20, 2023

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

Neeraj Kumar January 20, 2023

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.

1 vote
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 19, 2023

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.

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 19, 2023

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,

  • you can always export the confluence template on a word file
  • Make this file suitable for "mailing" and connect it to your csv
  • Export the pages in word
  • Import them back to confluence

I haven't try the above solution, but it has good possibility of success.

Neeraj Kumar January 20, 2023

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.

0 votes
Anna Hryhoruk _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 4, 2024

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 :) 

0 votes
Najjar _Innovura_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
July 4, 2024

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events