It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Possible to Call User Macro inside another User Macro?

Is it possible to call a user macro inside of another user macro?

If so, how?

If not, then is it possible to create functions inside a user macro to be called throughout the user macro?

If so, how?

3 answers

1 accepted

3 votes
Answer accepted

Add this to your user macro to get the gist of things

#macro (listStuff $name, $stuff)
        #foreach ($thing in $stuff)

#set( $stuff = ["Confluence","JIRA","Bamboo","Sourcetree"] )
#listStuff("Atlassian Software", $stuff) passes some stuff into a velocity macro and prints an unordered list.

Thanks! That's exactly what I was looking for. :)

Try this:

The cheese macro:

...or similar

Excellent! That works great!

I also found this (via

<ac:macro ac:name="someOtherMacro" />

But am I constrained to using user macro's? Is there the capability to create/use functions within a user macro?

I found this answer to be helpful too:

<ac:macro ac:name="toc">
    <ac:parameter ac:name="style">circle</ac:parameter>

With the current CONF version 6.9


We have a "subject" macro that creates the "excerpt" and a optional "toc".

To implement for C4 I tried this:

## @param toc:title=Inhaltsverzeichnis generieren|type=boolean|desc=Wenn aktiviert, wird ein Inhaltsverzeichnis erzeugt, das nicht mit gedruckt wird.|required=false|default=false

<div style="border-width: 1px;" class="panel">
<div class="panelContent">
<ac:macro ac:name="excerpt">
	<ac:parameter ac:name="atlassian-macro-output-type">BLOCK</ac:parameter>
#if ($paramtoc)
	<ac:macro ac:name="toc">
		<ac:parameter ac:name="printable">false</ac:parameter>

Unfortunately the <ac...> content is ignored (not rendered) completely.

Any ideas?


guess you should use:


This works very well for me in all situations where I have to "upgrade" usermacros to 4.x...

Sometimes I have to use a combination of "Insert Wiki-Markup" and a usermacro in the middle (e.g. for loops)

Not very comfortable to have to find out the "good old wiki markup syntax" for all the macros (to be used in user macros), but the confluence 3.5.x-Online-Help is very useful for this...

Or is there another way?

Just to give an example:

usermacro "space-access":

## @noparams
#set ($prevname = "")
#foreach ($perm in $space.getPermissions())
  #if ($perm.isUserPermission())
    #if ($prevname != $perm.getUserName())
      #set ($prevname = $perm.getUserName())
    #if ($prevname != $perm.getGroup())
      #set ($prevname = $perm.getGroup())

...must be used inside this in a wiki-page (included by "Insert Wiki-Markup")

{report-info:user:full name|link=true}

Not very comfortable, but at least it works!

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Portfolio for Jira

Program managers, we need your help! We want to learn about how you plan work for a team of teams

Hi community members, My name is Erika and I’m a product manager at Atlassian. We’re currently investigating how teams are planning work at the program level. We understand that every team in a tea...

52 views 0 4
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you