Creating a User Macro
Asked by Kevin McCreary:

The documentation indicates that you create a user macro from the General Configuration page. I can't find the link on that page. Am I missing something?


Answers:
author: Nic Brough -Adaptavist-
body: User macros cannot be defined by Cloud users, it's a restricted function. Only server installations can do it.


author: James Dellow
body: User Macros are a feature available in Confluence on-premise.

In Confluence Cloud you create custom macros (and other custom functionality) using the [Atlassian Connect framework](https://developer.atlassian.com/static/connect/docs/latest/index.html).

comments: author: Addie Hutchins
body: I know this is years old, but it's what I'm trying to do. But how would I use the Connect framework?


author: Nic Brough -Adaptavist-
body: Heh, the Connect framework has been quite superseded by Forge. Start with a read through <https://developer.atlassian.com/platform/forge/>


author: James Dellow
body: Yes, but Connect and Forge aren't quite on parity so there might be things you can't do in Forge but can do in Connect. This will change over time, so if you are reading this in the future you'll need to check the documentation for the latest.


author: Kirstin Seidel-Gebert
body: And consider the costs as you may need to pay using Forge after 2024: [Forge Will Continue to Be Free Through 2024](https://blog.developer.atlassian.com/forge-will-continue-to-be-free-through-2024/)


author: lnelson1
body: Anyone know of a Cloud add-on that allows a user macro function?

comments: author: Dominic Lagger
body: Don't exist...


author: James Dellow
body: BTW probably worth mentioning on this thread that in the last 12 months, Atlassian introduced another new cloud development platform, called [Forge](https://www.atlassian.com/blog/announcements/introducing-forge). It's currently in beta.


author: Ian Lim
body: Hi everyone,

Is it possible to add **Expand All** button in Confluence Cloud? I came across this link:

<https://community.atlassian.com/t5/Confluence-questions/How-to-create-an-quot-Expand-All-quot-button-for-Confluence/qaq-p/294206?tempId=eyJvaWRjX2NvbnNlbnRfbGFuZ3VhZ2VfdmVyc2lvbiI6IjIuMCIsIm9pZGNfY29uc2VudF9ncmFudGVkX2F0IjoxNjAzODQ3NDg0OTk1fQ%3D%3D#U1518036>

But then I saw your discussion about User Macro not possible in Confluence Cloud. Is that right?

comments: author: Nic Brough -Adaptavist-
body: Yes, Cloud does not have "user macros" (yet)


author: Dominic Lagger
body: [@Nic Brough -Adaptavist-](/t5/user/viewprofilepage/user-id/781454)

What do you mean by (yet)?  
Is it on the roadmap for cloud?


author: Nic Brough -Adaptavist-
body: There are plans to allow for a bit more flexibility, but it won't be user macros as we know them on Server/DC


author: Jose Solorio
body: Is this still true that the Cloud version of JIRA does not support user written macros?

comments: author: Nic Brough -Adaptavist-
body: Correct, and we expect it never will.


author: Elle Allen
body: :'(


author: Kevin McCreary
body: Yeah. Sucks.


author: Nic Brough -Adaptavist-
body: Actually, no, it does not "suck". A short story:

Last week, I spent 2 hours finding and fixing a strange error message for a client. They had done something in Confluence Server that broke a space (not a user macro, but similar). Total accident, one of those things that could happen to anyone.

But 2 hours of expense - ok for big places, but this could have been the client with 20ish users - 2 hours of my time is 6 months of operating their Jira and Confluence costs!

Now consider that Atlassian Cloud supports millions of users who could make similar mistakes, and think through the implications of support time. It gives you a stark choice between

* Give people access to functions that they could (and hence will) wreak havoc with and then genuinely demand support to get it fixed.
* Limit people to the safe functions that won't cause problems

You can imagine that anyone choosing the first is going to have to charge an absolute fortune to supply thousands of expert support operatives who can dive in and fix absolutely everything really quickly.

Atlassian has gone with the second, to keep the price down.

Personally, if I were a real support agent, I would not want to support anyone who "has enough rope to hang themselves with". That's exactly what user macros \*could\* do, even though 99.9% of us will find a better use for the rope, that 0.1% it going to cost far too much and take resources away from others who need help.


author: Kevin McCreary
body: Well thought-out response. I just disagree with it.


author: James Dellow
body: Atlassian does actually provide a pathway for developing enhancements for Cloud. Its not as hard as people think. However, I do wish they would provide people with a way to create simple user macros in Cloud (i.e. no scripts, just text and existing macros). The excerpt macros can be used for this, but there are scenarios where it doesn't work well.


author: Nic Brough -Adaptavist-
body: [@Kevin McCreary](/t5/user/viewprofilepage/user-id/2164846)- I'm not sure what there is to "disagree" with. Is it the choice Atlassian made not to cost a fortune?


author: Vince Swann
body: There's ways to avoid that though, for example:  

- make it quick and easy for users to turn macros off or to see which ones are enabled  
- disable them until a user manually performs a specific task that needs one then ask permission to enable that macro  
- enable them only for a period of time  
- only allow macros within an enhanced issue editor that must be explicitly requested by the user  
- supply a "safe mode" to quickly disable all but core functionality

There's so many ways to avoid having macros always on and silently changing behaviour without user knowledge. Many of those approaches are tried and tested in applications where security is a concern such as when opening office attachments from MS Outlook or explicitly enabling Outlook macros before being able to run them.

I'm not saying the choice to not support user macros on cloud is right or wrong - only that there are ways to mitigate the risks involved.


author: James Dellow
body: [@Vince Swann](/t5/user/viewprofilepage/user-id/1276065) some of what you've described is actually part of Confluence (server and Cloud) already. However, user macros in Confluence aren't quite the same as macros in the Office suite, so I'm not sure how that exact model would be applied to Confluence. It sounds like you are thinking of automation scripts?

The issue with allowing user macros in Cloud is how they are rendered on a page because they can include scripts. Instead in Cloud you have the option to create either static content macros (simple, no scripts) or dynamic content macros (scripting allowed, but runs inside an iframe). Other Cloud apps that might provide automation features can only run with scoped permissions, which the administrator is aware of when they install it (like when you add an extension to Google Chrome).


author: Maarten van Bree
body: [@Nic Brough -Adaptavist-](/t5/user/viewprofilepage/user-id/781454)/ [@James Dellow](/t5/user/viewprofilepage/user-id/502478) -- Talking about cost-effectiveness -\> how do I convert our widely used 50+ user macros to something usable in the cloud version?


author: James Dellow
body: Yes, that's going to be a challenge.

It will depend on what exactly those macros do.

Can you share some examples of the least complex and most complex user macros you have?


author: Nic Brough -Adaptavist-
body: Yep, you'll need to look at what each one is doing and find or write a Cloud app to provide the function (assuming Cloud Confluence hasn't implemented something that can cover it)


author: Kevin McCreary
body: Thanks for the quick replies. Right after I posted the question, I found the answer my self. You guys were too quick... I wasn't able to mark it as such!


Tags: cloud

confluence-cloud

user-macro