Skip to main content
Skip table of contents

Confluence - Create Page From Template

Overview

First, you will need your api token, confluence domain, and email.

You also need a URL of an already existing page within the space you want your new page to be uploaded – this is the Space URL.

Please note that the template you use must be a custom-made template in your agency. Here are two ways to view the list of such templates (for PMG): * * In Confluence* * You can go to the following page: * https://agencypmg.atlassian.net/wiki/templates?space=~7120206dae15ef5a8e433b85192cac9781d73a&template=2910748909&category=template.category.custom * Using the terminal: * Use the following terminal command to see the list of templates as the script sees them through the HTTP request. Please make sure to fill in your email and api token.

    curl -s -G 'https://agencypmg.atlassian.net/wiki/rest/api/template/page' \
  -u '<your-email>:<api_token>' \
  -H 'Accept: application/json'

If you would like to obtain the Template ID of a template, you can use the following terminal command. Please make sure to fill in your email, api token, and the template name.

curl -s -G 'https://agencypmg.atlassian.net/wiki/rest/api/template/page' \
  -u '<your-email>:<api_token>' \
  -H 'Accept: application/json' \
| jq -r '.results[] | select(.name=="<Exact Template Name>") | .templateId'

Variables

NameReferenceTypeRequiredDefaultOptionsDescription
Access TokenCONFLUENCE_ACCESS_TOKENPassword--Get yours at: https://id.atlassian.com/manage-profile/security/api-tokens
EmailCONFLUENCE_EMAILAlphanumeric--Your email address that is associated with your Confluence account.
DomainCONFLUENCE_DOMAINAlphanumeric--Your subdomain is the first part of the Confluence URL. For example, if your URL is https://agencypmg.atlassian.net/wiki/home, your subdomain is "agencypmg".
Page TitlePAGE_TITLEAlphanumeric--The title of the page to be created. Make sure it is unique within the space you are uploading to.
Space URLSPACE_URLAlphanumeric--The Space URL is the url of another page in the space where you want your page to be uploaded. Please provide the whole URL of that page.
Template IDTEMPLATE_IDAlphanumeric--The ID of the template you want to use as the basis for the created page. If you do not have this, provide the Template Name instead. Note: Only custom-made templates can be used here, please see the list of custom-templates on your agency's Confluence site.
Template NameTEMPLATE_NAMEAlphanumeric--The name of the template you want to use as the basis for the created page. Note: Only custom-made templates can be used here, please see the list of custom-templates on your agency's Confluence site.
Make it nested?IS_NESTEDBooleanFalse-If True, Page ID will be extracted from the Space URL and the created page will be nested under that page.
StatusSTATUSSelectnormalNormal: normal

Draft: draft

Live: live
Choose what type of page gets uploaded: 'draft', 'live', or 'normal' (default)

YAML

Below is the YAML template

YAML

source:
  template: Confluence - Create Page From Template
  inputs:
    CONFLUENCE_ACCESS_TOKEN:
    CONFLUENCE_EMAIL:
    CONFLUENCE_DOMAIN:
    PAGE_TITLE:
    SPACE_URL:
    TEMPLATE_ID:
    TEMPLATE_NAME:
    IS_NESTED: false
    STATUS: normal
  type: TEMPLATE
guardrails:
  retry_count: 1
  retry_wait: 0h0m0s
  runtime_cutoff: 1h0m0s
  exclude_exit_code_ranges:
    - 14
    - 102
    - 103
    - 99
    - 153
    - 2

      
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.