Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Convert PocketQuery template to cloud


We've just migrated our on premise Confluence server content to the cloud version, and our PocketQuery templates don't work anymore.

We were taking the results of a query which produces a list of Topics. These Topics refer to pages in the current Space (by title). We need to be able to create a table of links to the pages referred to by each Topic in the result set.

In our on premise server version I used $pageManager.getPage() to find the relevant page, but this seems to be deprecated. I tried converting it to using $contentService, but something is obviously wrong, because the page comes up saying there is a template exception. However, I can't seem to find where this exception is, so I don't even know what is going wrong.

Can someone tell me:

  1. How to do what we did originally with $pageManager?
  2. How to see the exception produced by the template?
  3. Where I can find more information about how to do these templates?

Thanks in advance.


For completeness, what we used to do in the server version was:

#foreach ($row in $result)
<td class="confluenceTd">
#if ($$pageManager.getPage($page.spaceKey, $ ## page already exists
<a href="$">$</a>
#else ## page doesn't exist yet
<a class="createlink" href="${req.contextPath}/pages/createpage-entervariables.action?templateId=5308417&spaceKey=$page.spaceKey&title=${generalUtil.urlEncode($}&linkCreation=true&fromPageId=$">$</a>
<td class="confluenceTd">

What I've tried in the cloud version is:

#foreach ($row in $result)
<tr style="border-bottom-width: 2px">
#set($pageFound = $contentService.find(new Expansion('version'), new Expansion('id')).withType(ContentType.PAGE).withSpace($page.spaceKey).withTitle($
#if ($pageFound) ## page already exists
<a href="$">$pageFound</a>
#else ## page doesn't exist yet
<a class="createlink"

and with debug switched on, I get the error:

12:35:12.770 ERROR An error occurred during Template rendering: The Template renderer stopped because of an ExecutionException. 


0 answers

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events