combine metadata and local-reporter macro

Hello,

I have a parent page and a set of children pages with metadata f.e.:

{metadata:SEC}IK1{metadata}
{metadata:SEC}IK2{metadata}
{metadata:SEC}IK5{metadata}
{metadata:SEC}IK10{metadata}
and so on

now, what I want to do is to list all metadata from children pages on parent page using local-reporter macro.

I tried something like this:

{metadata-from:{report-info:content:title|link=false}|NAME}

but that doesnt work

In other words: I dont know how to inject a current page name to {metadata-from} macro.

4 answers

1 accepted

This widget could not be displayed.

Try the reverse - get the metadata value via {report-info}. Metadata comes with a Supplier to allow retrieval via the Reporting Plugin. So, this should work:

{report-info:metadata:NAME}

Hopefully. :)

That's exactly what I'm looking for. However it doesn't work for me. More details below.

I have three pages - Two child pages named 'Meta child page 1' and 'Meta child page 2' and parent page named 'Meta parent page'. Child pages have "metatest" label.

Meta child page 1 code:

{metadata:Sec}IK1{metadata}
{excerpt}
Excerpt from Meta child page 1
{excerpt}

Meta child page 2 code:

{metadata:Sec}IK15{metadata}
{excerpt}
Excerpt from Meta child page 2
{excerpt}

Meta parent page code:

{metadata-from:Meta child page 1|Sec}
{metadata-from:Meta child page 2|Sec}
{report-table}
{content-reporter:types=page|labels=+metatest}{content-reporter}
{report-column:title=Page}{report-info:title|link=true}{report-column}
{report-column:title=Metatest}{report-info:metadata:Sec}{report-column}
{report-column:title=Excerpt (column header)}{report-info:excerpt|link=true|render=wiki}{report-column}
{report-table}

And that's what I get (see image)

Metadata is not visible, when I use reporter macro. I don't know where is the problem.

metadata plugin is v. 2.1.0 and reporter plugin is v. 3.4.2

This widget could not be displayed.

Not quite sure I understand your question, but have you tried something like this:

{metadata-report:Page,SEC|key=YOURSPACEKEY|root=@self|pages=@descendants|maxResults=1000|sort=Page}

If you need to filter further you could do so using

labels=label1,label2

(See https://studio.plugins.atlassian.com/wiki/display/META/Metadata+plugin+version+1+documentation for more information about metadata-reports)

Thx.

Do You know how to get an excerpt from the page using this macro?

I tried:

metadata-report:Sec,Page,Excerpt|key=TEST|root=@self|pages=@descendants|maxResults=1000|sort=Page|style=list}

where Sec is metadata's name, but it only lists metadata's value and link to the page. Excerpt is not visible.

Hi Pecet,

never used Excerpt - it is listed under additional internal metadata at https://studio.plugins.atlassian.com/wiki/display/META/Confluence+Metadata+Plugin#ConfluenceMetadataPlugin-Additionalinternalmetadata but apparently it isn't really working, at least not for me (just tried it out myself) :-(

... or I'm doing something wrong ...

Of course as a workaround one could always just simply define {metadata:Excerpt} and use that ...

This widget could not be displayed.

Hi Pecet,

Sorry, but what exactly do you want to achieve?

You got child-pages and each one of them has metadata on it (e.g. the first one hast {metadata:SEC}IK1{metadata}, the second one {metadata:SEC}IK2{metadata}, etc.)?
And on the parent page you want a list of all child-pages with their metadata?

Please clarify a bit.

Cheers,
Thomas

This widget could not be displayed.

I'm not sure exactly what the Metadata supplier details are unfortunately. However, you should be able to use Metadata's own standard display macros if you want - just don't specify the source location. Reporting renders reports in the context of the page they are reporting on, so as far as the metadata macro is concerned, it is executing on the original page.

Looks like I need metadata plugin is v. 2.1.3 at least.

Thx for all answers.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in Statuspage

What are your best incident management tips and stories? #HugOps

 👋Community members! Downtime happens. And great incident response takes a village. Teams like Support, Dev, SRE, Ops, IT, and Marketing have to come together to resolve the problem while keep...

70 views 2 3
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