Using confluence variables in PocketQuery

Paul Tedds December 12, 2017

We have pages with a large number of pocketquery macros to display different information. All of the queries take a simple alias relating to the page. Currently we have to enter this alias as a parameter for each individual query.

Is there any way to take a confluence variable and use it as a parameter for the PocketQuery statements. Ideally when using the page template the user should be able to enter the alias once and this is automatically used in all queries.

1 answer

0 votes
Sven Schatter _Lively Apps_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
December 12, 2017

Hey Paul,

just letting you know that we have moved our support over to our service desk for PocketQuery.

First you should look and see if wildcards solve your problem.

If this doesn't work you have a second option. So if this "alias" you are talking about is something you can get access to inside a Velocity template (for example the name of the page, or a macro parameter) then you could use

$PocketQuery.renderPocketQueryMacro()

in your template and simply pass the value as a parameter. You could make one big Template, which is responsible for rendering all the other PocketQuery macros. You could then pass this one big Macro a macro parameter of your liking and in the template populate the macro paramter to the other macros.

Have a look at our documentation to see what kind of Velocity objects you can use in your templates and how to use the renderPocketQueryMacro() function.

If you need further help please raise a ticket at our service desk and tell us more about what this alias is supposed to be. :)

Best regards,
Sven (Scandio)

Paul Tedds December 12, 2017

Hi Sven, getting the variable into a velocity object would be the difficult part. I will try with what you have suggested and see how I get on.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events