How you can read the page properties with a custom macro?

This question is in reference to Atlassian Documentation: Page Properties Macro

I would like to read the page properties and display the result in a custom layout.

I know the Free Plugin "GetMetadata" from Comala but with this plugin I can't read metadata in another page...

Can you help me?

Thank you!

3 answers

This widget could not be displayed.

I think it is of the form: $pageProperty.from("User") where User is the key. And $pageProperty.from("User", "123") when you have macros with IDs.

How to access from another page, I am not clear on, but maybe this gets you started and you can report back?

This widget could not be displayed.


I tried  $pageProperty.from("Field1") in a page with a property "Field1" but It doesn't work...

Where did you find the name of this calss? I didn't find it in the

My macro is:


## Developed by:  <your name>
## Date created: 27/07/2016

## @param filter:title=Filter|type=string|required=false|desc=Label filter



This widget could not be displayed.
Steven Behnke Community Champion Jul 31, 2016

It is not possible to lift the content of the 'page properties macro' directly. I'd like explain the difference between some things here – 

  • The question is pertaining to the Page Properties Macro, which is a page macro inserted into a page. A while in the past, this macro was called the Metadata Macro. It is called {details} in the storage format. Again, this has no direct API.
  • Bill Bailey is referring to the storage mechanism Properties, which can be applied to various content types in Confluence via the public APIs.


I believe the Page Properties Report macro searches for pages with the correct labels on them, parses the page content for the Page Properties Macros, and then pulls the interior <table> element for reporting. You would have to do the same to obtain the data inside the macro.

Steven Behnke Community Champion Jul 31, 2016

The JAVA API I am sure would be preferable due to speed. You could use the REST API to use a CQL query like such –

"You would have to do the same to obtain the data inside the macro."

Yes...And How I do that? I need to do that, i woluld like a custom layout.

Thank you

If you want to display data on the same page it is stored, the only solution I know of (and have used) is via the metadata plugin.Since it is free (and has been for years), that is the best/easiest solution.

Where I got the syntax was from here:

But even if that method is available, I typically have based variables using the metadata plugin.

Hello Bill,

To use page properties as placeholders:

  1. Open the root page of your exports.
  2. Insert a page properties macro to your page and a two-column key-value table.
    information The first column of the table will be the keys and the second one will be the corresponding values.
  3. Save the page.
  4. Open your template and insert the placeholder in the following pattern:$pageProperty.from("User")
    information Please note that the placeholders are case-sensitive.
    This placeholder will be replaced with the corresponding value stored in the content properties macro for the key with name "User".

  5. If you have multiple page property macros on your root page, you have to assign an ID to the macros and refer to this ID in your template.
    For example:$pageProperty.from("User", "123")
    This placeholder will be replaced with the corresponding value stored in the content properties macro with ID 123.


Step 1 : OK

Step 2 : OK

Step 3 : OK

Step 4 : ??? I need more explanation... 

Step 5 : OK

This is in reference to K15t velocity templates, but could give you a clue of how to address them (I haven't tried this). I am assuming that it will display the value on the page.

From the metadata plugin, there is the following method:

getMetadataValues(String token, String spaceKey, String pageName)



So... How I can use it?

In a macro like this?

<ac:structured-macro ac:macro-id="5b3f7bcc-12c8-4b82-afd6-93e41192cfb5" ac:name="metadata-values" ac:schema-version="1">
<ac:parameter ac:name="0">Source</ac:parameter>
<ac:parameter ac:name="1">SGDE</ac:parameter>
<ac:parameter ac:name="2">SYS-0004</ac:parameter>


  1. Source is the key
  2. SGDE is the space name
  3. SYS-0004 is the page name


This macro doesn't work...

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 17, 2018 in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

599 views 8 6
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