Macro inside macro?

I'm using Confluence with the Scaffolding plugin. I've got a frield called `postcode`, and I can get the value from it using report-info. However, when I try to embed this value inside another macro (in this case, the google maps one, to have an automatic map of the location), it fails. {report-info} returns the value correctly, but the outer macro is printed (so I see the {googlemaps-etc} text on the page), rather than being rendeder.

Can anyone suggest how to do this?

1 answer

1 accepted

1 vote
Answer accepted

Hi there,

I'm assuming you're trying something like this:

{my-macro:someParam={report-info:data:My Field}}

As you noted, that won't work - it's simply not how Confluence parses macros. There is a workaround however. You can 'inject' values into other macros by using the {report-on:injected=true} macro that comes with the Reporting Plugin. You can also use the {replace-and-render} macro from Adaptavist, but I'll leave that example for others.

To to use {report-on} in this situation, it would be something like this:

*My Parameter Value:* {text-data:My Parameter Value}
{report-on:injected=true}{some-other-macro:theParameter=%data:My Parameter Value%}{report-on}

The '%...%' markup is pasted in before the {some-other-macro} is executed, which should achieve what you're after. Check out the documentation for more details:

http://wiki.customware.net/repository/display/AtlassianPlugins/report-on

http://wiki.customware.net/repository/display/AtlassianPlugins/Suppliers

Hope that helps!

Regards,

David Peterson

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Tuesday in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

193 views 2 10
Read article

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