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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Asked 10 hours ago in Confluence

What are the resources that you use to learn more about Atlassian Products?

I am gathering information about resources available for Atlassian product knowledge transferring for a presentation in our local Atlassian User Group. I want to group them in four categories From ...

58 views 3 4
View question

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