Is there a way to automate this?
When a specific Confluence page is edited and the changes published --> then have it automatically create a PDF of the page and send the pdf via email?
I do not believe there are any built-in rule actions to generate the PDF; the REST API endpoints do not support that format for returning the content.
You may want to check the Atlassian Marketplace to find any apps to help: https://marketplace.atlassian.com/
Kind regards,
Bill
Hey @Wendy Grapentine , so yes, I think folks are curious about your use case because simply watching a page or creating an automation that emails folks about the edit seems like it would suffice.
I'm guessing your use case might involve folks who wouldn't have access to your Confluence, hence the need to send a PDF.
@Bill Sheboy is correct as usual that there's no Automation action nor an official API endpoint for generating PDFs of Confluence pages.
BUT... it brings me great joy to learn that there is an undocumented API endpoint to export PDFs. I had to dig it out of the atlassian-python-api library , and lord is it gnarly. :-D
I'll try to document what I've found soon, but suffice to say, the real problem is that the Email action doesn't let you add attachments to Emails (even though you can now format them all pretty - ha, several people asking there asking about attachments, and lo, there is hope!).
Anyways, real quick, the API thing is tricky.
First you need to POST a form request for the page_id, as described here in the get_page_as_pdf function from the Python library, that actually returns a web page, which you need to parse for "ajs-taskId" content=" (it's part of a <meta> tag).
Then you can call a different endpoint, described in the get_pdf_download_url_for_confluence_cloud function, which shows the progress of the export, and when it's complete, the state will change to "UPLOADED_TO_S3", and the result will be an endpoint that returns the URL to an S3 endpoint that is a link to the PDF.
Like I said, gnarly. I'll put this in a separate post.
As to how to tie all this together? I went down a whole rabbit hole of ideas for a similar ask about emailing Jira Issues as PDFs, and came to the conclusion that the best approach is probably a Forge app triggered by a web request.
So assuming you've Node.js background (or someone who can help, or maybe a good AI buddy), maybe you could do:
Since my presumption is that you want to email a PDF because the recipient doesn't have access to email (in which case you would've done something like @Kelly Arrey or @Marc - Devoteam suggested) there would be an issue with emailing a link to the attachment.
Because without permission to view Confluence, you can't see the attachments.
Now maybe you could work around this by adding the attachment to a page that is publicly shared?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The non-automation approach to solving this problem is to "watch" the page as described in the Watch pages ... documentation.
HTH,
Kel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why not create an automation that based on page edit notifies the required people via email?
Then the people are aware and can check the updated page.
Otherwise @Bill Sheboy is correct.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.