Skip to main content

2 min read

Change macro parameters in bulk on selected Confluence pages or blogs

update macro scriptrunner

‘Update Macro’ is the newest, easy-to-use built-in script in ScriptRunner for Confluence Server/Data Center. It enables Confluence admins to update the parameters of a particular macro that is used across multiple pages, spaces or blogs. The admin can specify a selection of pages, spaces or blogs where the macro is to be updated, or can make changes across all occurrences of the macro.

In a large Confluence instance where a macro is used hundreds of times across many pages, ‘Update Macro’ helps Confluence admins to:

  • Save hours of work by adjusting macro parameters in bulk, instead of having to first identify all the places where the macro exists, and then manually edit each appearence.
  • Keep things consistent by ensuring information is displayed and surfaced for reporting in the same way across various macros.
Update Macro built-in script in ScriptRunner for Confluence

‘Update Macro’ works on native Confluence macros and third-party macros alike. It is simple to use and doesn’t require any scripting. To start using it, go to the ‘Built-in Scripts’ tab in ScriptRunner and select ‘Update Macro’. Then follow the step-by-step instructions in the documentation.

Examples for ‘Update Macro’ in use

There are countless ways in which you could use this feature, but here are a couple of uses to inspire you. First up, I wanted to make sure that blog posts are displayed in an uniform way across a selection of spaces.

This video shows exactly how I use ‘Update Macro’ to modify the parameters of the native Confluence macro ‘Blog posts’ across multiple spaces.

For an example involving a third-party app, you can see how we use ‘Update Macro’ to update the code snippets in the ‘Include Bitbucket for Confluence’ macro from Mibex Software in our documentation. This can come in handy if, like us at Adaptavist, you need to update code snippets in your documentation whenever you release a new version of your product.

Where do we go next?

We're extending the possibilities of this new feature even further.  'Update Macro' will soon be able to transform a parameter rather than simply replace it, or update content within a macro. For example, you will be able to update all the Markdown Macros in your instance to point to markdown files in Bitbucket instead of GitHub (or vice-versa) with a simple click.

Tell us what you think

We’d love to know what you think of the new features! Please share your feedback and experiences on our support portal.

Don’t have ScriptRunner for Confluence? Why not give it a try?

Get a Free 30 Day Trial