How to get all confluence global templates to the JIRA Administration Page webwork action using JAVA

I have a JIRA Webitem at the System Adminstration section.

On the Page, I wanted to display the list of Confluence Global Template.

Since there is no REST API's for fetching the global templates, Is there a method to fetch the global templates by using application links java object?

1 answer

1 accepted

Hi - it looks like there is a REST API in Confluence Cloud to retrieve the global templates: Get blueprint templates

Please let me know if that is helpful for your case.

If you are using Server, the API isn't documented: 

Confluence REST API Documentation

But it looks like some versions have had an experimental API you can use:

how i can get confluence templates via rest api

 

Thanks for Reply @Ann Worley.

Since I am using confluence version 5.6.5, i couldn't get the API. And also it is experimental, which I am not comfortable to use it.

Is there any Templates Related JAVA Class/interface/Methods, that i can use to get all the Global Templates?

Ann Worley Atlassian Team Dec 18, 2017

I understand you would like to know how to use JAVA resources to display a list of Confluence page templates in Jira. You are using Confluence 5.6.5 and are not interested in an experimental API.

I have not forgotten our thread, am following up with some developers internally but most of them are in APAC and it is a slow time of year, so it is taking a while. Thanks for your patience. 

Ann Worley Atlassian Team Dec 19, 2017

@arunkThe answer I got was that you would need to write a plugin for Confluence that provided the API then use the API in Jira. You may use:

@ComponentImport com.atlassian.confluence.pages.templates.PageTemplateManager 

to obtain the list of templates (global or space).

Thanks for the quick reply @Ann Worley, Will try your suggestion and let you know.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

377 views 20 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you