How to export an issue and its linked Confluence page
Here we will show you how to create an operation that lets your users download a ZIP file containing the PDF exports of the issue and a linked Confluence page. This example requires version 11.0.0 of the Issue Publisher or later.
Create the operation
On the Manage Operations page create a new Single Issue Operation. You only have to enter a name and optionally a description here.
Add the first step
Add the first step which creates the PDF export of the issue.
We are using the Create a PDF file action with the Default Printable Issue View Template here.
The created file is kept in the operation storage so we can access it in the last step.
Create a new Web Request Template
On the Manage Templates page create a new Web Request Template using the following inputs:
Name | Get Confluence Page Export |
---|---|
Method | GET |
Path | /spaces/flyingpdf/pdfpageexport.action?pageId=$!issueHelper.getPageIdFromFirstConfluenceLink($issue) |
If you store the page ID of your Confluence page in a custom field, you could also use something like $!fieldHelper.getValueAsString("Page ID")
instead of $!issueHelper.getPageIdFromFirstConfluenceLink($issue)
in the path.
Add the second step
Add the second step which retrieves the PDF export of the linked Confluence page.
We are using the Retrieve file using web request action with our newly created web request template here.
Again we are keeping the created file in the operation storage so we can access it in the last step.
If your issue might not have a linked Confluence page, you should set the error handling to Ignore.
Add the third step
Add the third step which creates the ZIP file containing the PDF exports of both the issue and the linked page.
We are using the Create a ZIP file action and the option to include the files from the operation storage.
As file name for the ZIP file you can enter issue-export-${issue.key}.zip
or something else.
You can let your users download the ZIP file by selecting the Show as download option. Alternatively (or additionally) you can also save the file as attachment on the current issue.
Using the operation
If you chose the Show as download option, your users will see the following dialog after executing the operation.