How to find all user defined templates in confluence ?
Asked by Sushmitha:

I have Confluence admin access.

Can I find list of all user defined templates of different spaces in confluence ?

Is it possible to use or move template of one space to another space ?


Answers:
author: Amal - Seibert Solutions
body: Hi there,  

Is there still no possibility to get a list of all space templates?  
Neither with SQL nor with REST API?

Shouldn't it be possible to get it from the DB?

I didn't verfy the SQLs yet, but I think they should work.

select \* from spaces where PAGETEMPLATES is not NULL  

select \* from PAGETEMPLATES p, SPACES s

where p.PAGETEMPLATEID = s.PAGETEMPLATES

|---------------|------------|------------------|----------------|-----------------------------|----------------|
| PAGETEMPLATES | TEMPLATEID | CONTENT_LABEL    | PAGETEMPLATEID | FK28KIFOKT21QD9GES0Q0WV0FB9 | PRIMARY_KEY_BC |
| PAGETEMPLATES | TEMPLATEID | PAGETEMPLATES    | PREVVER        | FK4WGWY1DQCI8RCWAD4TNQBGLT8 | PRIMARY_KEY_BC |
| SPACES        | SPACEID    | CONTENT          | SPACEID        | FKLMWEU06NFT59G7MW1I1MYORYS | PRIMARY_KEY_92 |
| SPACES        | SPACEID    | NOTIFICATIONS    | SPACEID        | FKMQE1PHE52XWQC4HK4IB8P9EH6 | PRIMARY_KEY_92 |
| SPACES        | SPACEID    | PAGETEMPLATES    | SPACEID        | FK18A1D37PVQ2O9HU5X3TPS97MX | PRIMARY_KEY_92 |
| SPACES        | SPACEID    | SPACEPERMISSIONS | SPACEID        | FKBI3X723M8FBGOKO3S84F9ODDL | PRIMARY_KEY_92 |

<br />

<br />

Best,   
Amal

comments: author: Andrew Yeaman
body: I have used the following in SQL:

```
SELECT CONCAT('[', s.SPACEKEY, ':]') Space, 
s.SPACEKEY SpaceKey, 
s.SPACETYPE Type, 
s.SPACESTATUS Status,
t.TEMPLATENAME 'Template Name',
format(t.LASTMODDATE, 'dd-MMM-yyyy') 'Last Modified',
isnull(cu.display_name, um.lower_username) 'Last Modified By'
FROM PAGETEMPLATES t
JOIN SPACES s on t.SPACEID = s.SPACEID
LEFT JOIN user_mapping um ON t.LASTMODIFIER = um.user_key
LEFT JOIN cwd_user cu on um.lower_username = cu.lower_user_name
Order By s.SPACENAME
```


author: Sam Lucas
body: Hi [@Sushmitha](/t5/user/viewprofilepage/user-id/4656691) \& [@Gaby](/t5/user/viewprofilepage/user-id/4011717) ! I am a new PM for Confluence Templates! I am exploring template permissions, moving templates across spaces, etc. I'd enjoy a quick zoom call with each of you if you're interested an available to learn about your desired functionality and specific templates use cases! [Please book a time with me!](https://calendly.com/slucas-atlassian/30min?month=2023-01) thx.


author: Gaby
body: I agree with Brant's statement.  
We use the templates mainly from globally created templates (Administration - Settings - Global Templates and Blueprints).

With this, we have the overview of existing custom templates via the TEMPLATES button in the Confluence main menu row.

For a few areas, templates are explicitly set. In two cases we then copied and pasted the templates in 3 other areas. So no effort and due to the insignificance no need for a list.

But I would vote for a new feature with. Maybe it makes sense to give the custom templates the possibility to assign categories to them, which then allow conclusions to the respective area...?

Greeting - Gaby


author: Brant Schroeder
body: [@Sushmitha](/t5/user/viewprofilepage/user-id/4656691) There is no way to do this in the delivered product and I do not know of any apps that provide this functionality.


Tags: confluence-server

server