It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How can set the page properties report macro in a template to refer to current page programatically?

I want to create a template that includes a page properties report macro to show a list of child pages, limited to only show the current page's children.

I have upgraded to 5.8 so can take advantage of the "with Parent" field, but I can't see a way to set it in the template so that field is automatically set to the new page created by the template.

I guess I'm looking for @self or something similar so that I don't have to set that macro every time I create a page from the template.

7 answers

Hi. There is an option in the parameters of the page properties report macro to do this.

Select 'Add a filter'

Select 'With ancestor'

And select Current page.


Now the report only brings up the child pages.


Page Properties macro.PNG

It worked for me. Thank you.

I have looked at the page in the Source editor. After creation, the macro looks like this: <ac:structured-macro ac:macro-id="70bb97d7-6709-41ea-a6a4-e86ad0830c77" ac:name="detailssummary" ac:schema-version="2"> <ac:parameter ac:name="label">requirements</ac:parameter> <ac:parameter ac:name="cql">label = "requirements" and space = currentSpace() and parent = "2359318"</ac:parameter> </ac:structured-macro> The space filter is using a method currentSpace(). I have tried applying that logic to parent, using parent = currentPage() but that method doesn't exist. So is there an equivalent method for the current page?

I'm also looking for this feature - seems it's missing currently.

I also expected this update to page properties report macro to allow you to be able to limit reporting to the current page's children.

Looking for this feature as well! Wonder how it could be missed ...

Did anyone find a solution for this? Trying to do the same.

I do not know how to to it with the Page Properties Report Macro, but you could use other add-ons to limit the result set to children.

For instance the (commercial) projectdoc Toolbox Add-on has the Display Table Macro which supports the parameter Restrict to immediate Children. Note that you need to use the Document Properties Marker Macro instead of the Page Properties Macro provided by Confluence.

The code for the macro in storage format looks like this:

    &lt;ac:parameter ac:name="doctype"&gt;asset&lt;/ac:parameter&gt;
    &lt;ac:parameter ac:name="render-no-hits-as-blank"&gt;true&lt;/ac:parameter&gt;
    &lt;ac:parameter ac:name="render-mode"&gt;definition&lt;/ac:parameter&gt;
    &lt;ac:parameter ac:name="select"&gt;Name, Short Description, Rating&lt;/ac:parameter&gt;
    &lt;ac:parameter ac:name="restrict-to-immediate-children"&gt;true&lt;/ac:parameter&gt;
    &lt;ac:parameter ac:name="sort-by"&gt;Sort Key, Name&lt;/ac:parameter&gt;

Biased Alert: I'm one of the authors of this add-on. :smile:

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Confluence

What project did you transition or start on Confluence with the shift to remote work?

It’s been great to hear from fellow users over the last few weeks about the best tips and fun moments you’ve had working on Confluence since the transition to working remote. I’d love to keep the c...

227 views 3 8
Join discussion

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you