How are parameters defined with the user macro module

There is a line on the Atlassian developer documentation page on the User Macro Module that intrigued me:

User macro plugin modules are functionally identical to Writing User Macros configured through the administrative console, except that they can be packaged and distributed in the same way as normal plugins.

I have a bunch of user macros, some rather complicated, that I constantly need to move from one site to another. So if I could package them as a plugin, my life would be great. Unfortunately, the quote above seems to only be true for simple "Hello World" user macros. There does not seem to be any documentation on how to set up parameters that you have in user macros so they work when using the user macro module. After wasting hours trying to figure it out, I used the parameter notation of the macro module and now I'm close. However, you can't seem to specify a title or a description for the parameter like you do for the user macro using the admin UI. So the users sees whatever cryptic name you gave the parameter so you could refer t it in your code, not some nice name that is more user friendly. And it also appears you can't have uppercase letters in the name of the macro. This means anyone who has used the macros in the past would see UI differences, and uglier ones at that. This makes this whole idea worthless to me, unless the documentation on this page is just so bad that I'm missing how to do the obvious.

So... can someone set me straight and show me how I can really take a user macro that uses all the capabilities of the Admin UI and package it as a plugin. I'd love it if the above quote were true, but right now it appears to be just a good idea, poorly implemented!

Specifically, if I have a user macro with a parameter that has a "title", "desc", and "default" attributes (which user macros allow), how do I define that parameter so it works the same way using the User Macro Module?

Additionally, if my user macro has a Title that has uppercase characters and is different than the name to give users a user-friendly name for it in the macro browser, is there a way to keep that title when I try to package the user macro in a plugin using the user macro module?

Appreciate any insight anyone can offer!

1 answer

1 accepted

1 vote
Accepted answer

Think I figured it out. You need to provide all titles and descriptions in a seperate "i18n" properties resource file. The ATLAS-CREATE-CONFLUENCE-PLUGIN script creates this file for you. It is the name of your plugin with a .properties extension. In that file, you can give good labels and descriptions for the macros and the parameters. The format of these assignments is covered on this page (found after many hours of searching).

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 24, 2018 in Confluence

Atlassian Research opportunity with Confluence templates

Do you use templates with Confluence? Take part in a remote 1-hr workshop. You'll receive USD $100 for your time!   We're looking for people to participate in a   remote 1-hr workshop...

1,104 views 17 14
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