Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article explains how to prevent the parent folder name being added appended to the page created in confluence using Confluence using the Confluence Command Line Interface app.

Instructions

Follow the below steps to below to pull the HTML content into the Confluence page without appending the title of the page to each .html files using runFromCsv and addfiles using runFromCsv and addPage CLI actions: 

  • runFromCsv runFromCsv: Runs all the actions generated from the CSV file with the parameters mentioned.
  • addPage: Create a confluence page.
  1. Create a .csv file with column headers space, title, parent and file and  file and input the values as values as shown below:
    Image Modified

    Here, we are keeping the files are placed in the CLI client location. 
    Image Modified

    Here is a sample HTML file:
    Image Modified
  2. Execute Run the below CLI action:

    Code Block
    themeMidnight
    --action runFromCsv --file "Files_Folder/HTML.csv" --common "--action addPage --replace --markdown"

    The output is displayed on the Confluence page as per based on the command executed:
    Image Modified

    Output on the Terminal:
    Code Block
    themeMidnight
    Run: --space "CLI" --title "CLI_Title_1" --parent "addPage_CLI" --file "Files_Folder/File1.html" --action addPage --replace --markdown
    Page created as 'CLI_Title_1' in space CLI as child of 'addPage_CLI'. Page has id 11534344.
    
    Run: --space "CLI" --title "CLI_Title_2" --parent "addPage_CLI" --file "Files_Folder/File2.html" --action addPage --replace --markdown
    Page created as 'CLI_Title_2' in space CLI as child of 'addPage_CLI'. Page has id 11534345.
    
    Run: --space "CLI" --title "CLI_Title_3" --parent "addPage_CLI" --file "Files_Folder/File3.html" --action addPage --replace --markdown
    Page created as 'CLI_Title_3' in space CLI as child of 'addPage_CLI'. Page has id 11534346.
    
    Run completed successfully. 3 actions were successful from file: Files_Folder/HTML.csv
    


Info

If the file(s) are at a different location,

then

you have to enter the full path of the HTML file under the file column.