The issue

The Atlassian Logo
"Atlassian-logo" by www.atlassian.com - https://www.atlassian.com/ko/dms/wac/images/press/Resources/presskits/HipChat_Fast_Facts.pdf. Licensed under Public Domain via Wikimedia Commons. Figure 1

I was trying to solve an issue, amidst the documentation haze for my latest applications, to create a new page with a given template from a link, to spare me the hazzle of doing it "manually".

Investigation

I did my homework and tried to find other similar issues, when I found this issue at Atlassian Answers. The answers there did not help, but one of the commenters pointed out you can manipulate the query string to resolve the issue. The problem was that the commenter did not use the correct URL.

The solution

I inspected the URL that created a new page when you select a template, and found this solution:

http://domain.com/pages/createpage-entervariables.action?spaceKey=<spacekey>&fromPageId=<parent page id>&templateId=<template id>

This should also work:

http://domain.com/?spaceKey=<spacekey>&templateId=<template id>&newSpaceKey=<spacekey>

Sugar

If you want to automatically locate all undefined links and inject the correct URL for creating a new page with a specified template, you can do something like this:

Add this code snippet in a HTML code block addon on the page where you want to alter the links.

Happy documenting!