Anyone have an example of using CLI to attach a csv file and display it in confluence?

If I have a file "file1.csv" stored on a server say "file-server1" and I wanted to display the file in confluence how would I go about setting up CLI to do it? I add the macro to a test page but don't know what to put in the body of it

1 answer

Normally, you would use the CLI to take the contents of the file and populate a page with the data. For example:

--action storePage --space myspace --title file1 --file file1.csv --content "{noformat}" --content2 "{noformat}"

If you have the Table Plugin for Confluence, then you can replace the noformat macro with the csv macro.

Another approach is to just use the csv macro directly and access a file located in the script directory in the home directory of the Confluence server. See CSV Macro .

I will give this a try and get back to you. Thanks for the speedy reply.

I am now getting a "Error rendering macro 'cli' : Security restricted macro with parameter 'product' and parameter value 'confluence' is not allowed on this page. A page edit restriction is required that matches the macro authorization list." Error. WHat should change in the \\conflluence-server\ConfluenceData\macro-security.properties file to allow the macro to run?

or if it could read the data from the csv then display it on the current confluence page.

cli is a macro security controlled macro and so needs an entry in your macro-security properties - something like:

cli=confluence-administrators
cli.profile.*=confluence-administrators 

For your other question, see the answer regarding the use of the csv macro.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted yesterday in Featured Groups

Tuesday tips & tricks: What is the Atlassian Community?

It's officially Tuesday, which means it's officially time for another tip to help you better navigate this space we call the Atlassian Community. 😄 I got a great question from community member, Sa...

44 views 2 4
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you