Confluence CLI Tool, selecting pages by date, then export as PDF

Hey

There is a couple of example out how to export pages as pdf's via CLI

Now I would like to know if I can create a list via getPageList and select only for pages created after a certain date.

Is that possible?

thanks

4 answers

This widget could not be displayed.

Are you trying to export the list of pages, or the pages themselves?

This widget could not be displayed.

pages themselves - so I would use PageList with date and only export those pages that have a recent created or modified date thanks c.

This widget could not be displayed.

So I've mastered how to get CLI to spit out a list of pages within a specified date range, even got it to export it as a .txt file (that could be used as a .csv file, with heading information included and comma-separated). But getting the exportPage function to export from a file source doesn't seem to be possible as of yet. I can dream up another combination of solutions, but I wonder if you need to adjust your approach a bit or use some other addons. For instance, this would be much easier to accomplish using ServiceRocket's Reporting plugin. You could even use a simpler solution with content reporting macros (or other built-in, free macros) to generate a report. You would need a very complex solution to achieve this with the current requirements, with exporting the actual pages themselves being the biggest blocker. In any case I'll post my partial solution as an answer and see if someone else from the community might be able to weigh in and provide some insight.

This widget could not be displayed.

Here is part of the solution...

While getPageList seems like the best route, I just couldn't get it working right away. But getContentList seemed promising, and sure enough I was able to get it to generate a list of pages modified within the LASTDAY, and I even made it export the list as a comma-separated .txt file (something which isn't even listed as an option for this action, very exciting!).

confluence --action getContentList --search "type:page" --space HOME --searchTypes "page" --searchModified "LASTDAY" --outputFormat 2 --file "target/output/atlassiancli/getContentList.txt"

With all that said, however, I was not able to turn this list into an exported PDF of the actual pages, which was OP's original goal. So if anyone wants to take this solution a bit further I'd would love nothing more!

I may tinker with this a bit more later, but for now I'm a bit stumped. 

If the problem is exporting ALL the pages selected to one PDF, then that is not currently supported by the remote APIs as far as I am aware currently.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 17, 2018 in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

602 views 8 6
Join discussion

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