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

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Published 14 hours ago in Confluence

Think you know shares vs. @mentions in Confluence? Take this collab quiz.

To anyone who doubts that Atlassians are a little too obsessed with collaboration, and tools related thereto, let me describe a recent discussion we had (which took place on our internal Confluence, ...

99 views 2 4
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