Is there a way to automatically update the Confluence copy of a file with the new version of the source file on a daily basis?

This question is in reference to Atlassian Documentation: Attaching Files to a Page

Ask your question here...

5 answers

0 votes
Steven Behnke Community Champion May 27, 2016

What is the source file? Confluence has an extensive API so you could easily do this with any scripting language outside of Confluence.

It's just an excel file on a network filestore location. 

Do you have any recommendations of websites with example code I can modify?

Everytime you attach a file with the same name you will get a new version. You can attach files using REST API and curl. Here is an example:

curl -v -S -u admin:admin -X POST -H "X-Atlassian-Token: no-check" -F "file=@myfile.txt" -F "comment=this is my file" "http://localhost:8080/confluence/rest/api/content/3604482/child/attachment" | python -mjson.tool

 

The localhost URL needs to change to your wiki URL. The example is from this page:

https://developer.atlassian.com/confdev/confluence-rest-api/confluence-rest-api-examples

Cheers,
Peter T

 

I'm confused by the use case sad

the Excel file seems to be on a general file server which people can edit.

Then once a day you want to store a back up of that file in Confluence which will hold all previous versions of the file as archived copies - why???  i.e. after one year do you really want Confluence to hold all 365 daily versions of that file?

Why can't your people changing the Excel file on your server, instead of opening the server file, changing it and saving, they just access Confluence, download that file, do their changes and upload it again?  I know it is a little different to just double clicking a file on your PC browser.

Or if it is  a simple table stored as an excel spreadsheet, just create a table on a Confluence page so people just edit the Confluence page

 

Rodney, it has to do with aggregating info from/to different systems/sources.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

716 views 2 13
Read article

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