How do I create a duplicate/copy of a user-created template?

Allison Kelsey
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 7, 2024

The answers on previous threads are no longer valid. 

 

I want to copy an existing user-created template so that I can modify it.

2 answers

1 accepted

3 votes
Answer accepted
Dave Rosenlund _Trundl_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 7, 2024

Hi, @Allison Kelsey

Unfortunately, there is no easy way to duplicate or copy a template with Confluence. There's a long-standing enhancement request for it, but no progress on it yet.

The clunky workaround is to copy/paste from a template into a new custom template that you create.

You may also want to have a look at some of the templating apps for Confluence on the Atlassian Marketplace. I believe some of these offer this capability.

Best,

-dave

P.S. you may want to add your vote to the enhancement request

0 votes
Andrii Maliuta
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 8, 2024

Hello @Allison Kelsey ,

You can try to use Confluence  Java API to do this:

 

import com.atlassian.confluence.pages.templates.PageTemplate;
import com.atlassian.confluence.pages.templates.PageTemplateManager;


PageTemplate originalTemplate = pageTemplateManager.getPageTemplate(TEMPLATE_ID_HERE);

PageTemplate newTemplate = new PageTemplate()

newTemplate.setCOntent(originalTemplate.getContent())
newTemplate.setName(originalTemplate.getName())
newTemplate.setVersion(1);
...
pageTemplateManager.savePageTemplate(newTemplate, originalTemplate);

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events