Jira Gadgets fail to load in Confluence with a "Error rendering macro 'gadget'" error

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Jira Gadgets are not working in Confluence with the following error:

(Auto-migrated image: description temporarily unavailable)

Error in text format

1 2 3 Error rendering macro 'gadget' The gadget at http://charlie.atlassian.net/rest/gadgets/1.0/g/com.pyxis.greenhopper.jira:greenhopper-gadget-sprint-health/gadgets/greenhopper-sprint-health.xml was not added to this Confluence instance yet.

The Sprint Health Gadget was used as an example here, but other Jira Gadgets can be affected the same way.

Environment

Confluence Server and Data Center.

Diagnosis

  1. There is a valid Application Link connecting Confluence and Jira.

  2. Jira is registered in Confluence as an External Gadget Feed.

  3. The error mentions a URL that does not match Jira's current Base URL.

Cause

The Jira server or data center 'base URL' has changed (possibly due to a migration) but the macro references were not updated to the new URL in Confluence.

Solution

Update the affected macros with a valid 'base URL' so it points to the current Jira server or data center instance.

Option 1 - Source Editor

If only a handful of macros need to be fixed, using the Confluence Source Editor* app is the quickest and safest approach.

Although the Marketplace page mentions the Confluence Source Editor is for Confluence Server only, it can be installed in Confluence Data Center instances and should work as well.

In order to do that:

  1. Install the Confluence Source Editor app in your Confluence server/data center.

  2. Navigate to the affected page and select Edit at the top of the page.

  3. Select the Open in source editor button ('<>' symbol in the upper-right corner).

  4. Locate the <ac:parameter ac:name="url"> parameter.

    (Auto-migrated image: description temporarily unavailable)
  5. Replace the invalid URL with the correct one. For the example, we should replace 'charlie.atlassian.net' with a new URL that points to the correct Jira Server/Data Center endpoint.

  6. Click Apply then Update

  7. Refresh the page.

Here's an example of how the Sprint Health Gadget looks in Storage Format:

1 2 3 4 5 6 <p> <ac:structured-macro ac:macro-id="a1523271-9080-40f9-8c0f-aa234f7f0b0e" ac:name="gadget" ac:schema-version="1"> <ac:parameter ac:name="preferences">rapidViewId=1&showRapidViewName=true&sprintId=1&showSprintName=true&showAssignees=false&isConfigured=true&refresh=15&=false</ac:parameter> <ac:parameter ac:name="url">http://charlie.atlassian.net/rest/gadgets/1.0/g/com.pyxis.greenhopper.jira:greenhopper-gadget-sprint-health/gadgets/greenhopper-sprint-health.xml</ac:parameter> </ac:structured-macro> </p>

Option 2 - Database Manipulation

Find-Replace operation

A 'Find-Replace' operation on the database may be necessary if several macros need to be fixed.

Make sure to back up your database before performing any changes! We strongly recommend testing this approach on a testing or staging environment before implementing the changes in production!

To change the URL in the database to another URL:

  1. Stop Confluence.

  2. Create a backup of Confluence's database. Save somewhere offsite for safekeeping.

  3. Run the following SQL query on Confluence's database:

    1 2 3 UPDATE BODYCONTENT SET body = replace(body,'old-url','new-url') WHERE body LIKE '%old-url%';
  4. Verify that the bodycontent table now has the new url.

  5. Start Confluence.

Specific URL reference

In order to change Macro references only, we suggest using a more targeted UPDATE statement. For instance, in step 3 above, use this SQL UPDATE statement instead:

1 2 3 UPDATE BODYCONTENT SET body = replace(body,'<ac:parameter ac:name="url">http://charlie.atlassian.net','<ac:parameter ac:name="url">http://jira.charlie.com') WHERE body LIKE '%<ac:parameter ac:name="url">http://charlie.atlassian.net%';

ℹ️ This will replace http://charlie.atlassian.net with http://jira.charlie.com.

Using the UPDATE statements will replace ALL references to the old URL, including plain-text entries in Pages, Comments and Blog posts in the database. 

Updated on April 11, 2025

Still need help?

The Atlassian Community is here for you.