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
4,323,712
Community Members
 
Community Events
168
Community Groups

How to access metadata in a user macro

I want to access metadata set on a page in a user macro, but no idea as to what the object name and methods would be.

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

You can also access some of the meta data that Confluence puts on a page via Javascript (which can be in a user macro). The method is ..

AJS.Meta.get("key");

The key part is what is in the meta tags on the page minus the "ajs-". So for instance if the meta tag is

<meta name="ajs-remote-user" content="dstuder">

You could get the value via ...

AJS.Meta.get("remote-user");

You can see all of the available ones via...

AJS.Meta.getAllAsMap();

Hello David,

Can you explain with more details?

I would like to acces metadata in content of a page with a macro like that

$page.getmetadata(FieldName)...

Thanks!

TAGS
Community showcase
Published in Apps & Integrations

4 Amazing Product and Project Management Apps compete for Best App Demo in July Appy Hours 🥳

Thanks so much to everyone who joined for our July Appy Hours! Product and project management presenter highlights  Checkout - Procurement and asset manager, presented by @Vincent Mutambuki ...

95 views 1 9
Read article

Atlassian Community Events