User Macro doesn't appear in the Macro Browser

I asked this question some time ago but was unable to test it until now. This is Confluence 5.0

I built the macro as shown. It works perfectly well, but isn't appearing in the Macro Browser. In the macro editor, these settings are ticked or selected:

  • Visible to all users in the Macro Browser
  • Category = Navigation
  • Macro icon = blank (is this necessary?)
  • Documentation url = a page in our wiki, written as a full url eg

    http://mywiki.com/display/spacekey/wiki+page
  • Macro Body Processing = rendered

I've had a dig through the documentation including this nice page: Including Information in your Macro for the Macro Browser but I don't see anything helpful there.

(Interestingly my original old macro that does the same thing also continues to work even though it has a red flag against it. It doesn't appear in the Macro Browser either. )

 

(Minor edit: fixed the documentation url)

1 answer

1 accepted

I discovered a bug in Confluence 5.5.2 where if your user macro doesn't have any parameters, it will not show up in the Macro Browser. I didn't check Jira to see if this had been already reported. But you can workaround it by adding a "dummy" parameter to your macro.

For example, the following macro will NOT appear in macro browser:

## Macro title: Next Step
## Macro has a body: Y
## Body processing: Rendered
##
## Developed by: C. Rand McKinney
## Date created: 18 July 2014
## Installed by: C. Rand McKinney
<div style="font-size: 11pt; font-weight: bold; border: 1px solid #cccccc; background-color: #EBF5EB; padding: 10px; border-radius: 3px; margin: 10px 50px 10px 50px;">
$body
</div>

But if you add a "dummy" parameter as follows, it will appear in macro browser:

## Macro title: Next Step
## Macro has a body: Y
## Body processing: Rendered
##
## Developed by: C. Rand McKinney
## Date created: 18 July 2014
## Installed by: C. Rand McKinney
## @param Name:title=Reviewer Name|type=string|required=false|desc=Your name 
<div style="font-size: 11pt; font-weight: bold; border: 1px solid #cccccc; background-color: #EBF5EB; padding: 10px; border-radius: 3px; margin: 10px 50px 10px 50px;">
$body
</div>

Thank you. Sorry for the delay in replying. I can't test this out right now (test system was deleted, upgrade is still pending). I'll revisit this as & when and let you know if it works for me or not.

You don't necessarily have to create a dummy parameter, you can instead include the following line at the top of your user macro:

## @noparams

This will also prevent an error message from showing in the user macro browser.

Thanks, Rand & Stephen -- it's working AND appears in the macro browser.

Thanks Rand and Stephen. I had the same problem and it was driving me nuts for weeks. You guys saved the day!

Neither adding

## @noparams

nor

## @param Name:title=Reviewer Name|type=string|required=false

in 5.9.x doesn't help to display User Macros in specified category of Macro Browser.

It is possible to find such macros only by searching by macros name.

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
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

172 views 1 17
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