Cannot resolve nested Forge macros via macro-by-ID REST API

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Medium
    • Component/s: Ecosystem
    • Minor

      Issue Summary

      When using the macro-by-ID REST API with Forge macros, top‑level Forge inline macros work as documented: using the ADF local-id as {{

      {macroId}}} returns the macro’s parameters.

      However, the same Forge inline macro returns 404 Not Found when it is nested inside a Forge bodied macro, even though:
      * The nested macro exists in the page’s storage as ac:adf-extension / inline-extension

      * It has a valid parameters.local-id that matches the {{{macroId}

      }} in the request

      • The content ID, version, and user permissions are all correct

      So currently only top‑level Forge macros can be resolved by local-id via this endpoint; nested Forge macros cannot.

      Steps to Reproduce

      1. Create a Confluence page.
      2. Add a Forge inline macro directly on the page (top-level).
      3. Add a Forge bodied macro on the page.
      4. Inside the bodied macro, insert the same Forge inline macro type.
      5. Publish the page.
      6. Retrieve the page storage (e.g. GET /wiki/rest/api/content/{contentId}?expand=body.storage) and collect:
        1. local-id for the top-level inline macro
        2. local-id for the bodied macro
      7. Call:
        • Top-level:
          GET /wiki/rest/api/content/{contentId}/history/0/macro/id/{local-id-top-level} → 200 OK
        • Nested:
          GET /wiki/rest/api/content/{contentId}/history/0/macro/id/{local-id-nested} → 404 Not Found

      Expected Results

      Both the top-level and nested Forge inline macros should be resolvable via:

      GET /wiki/rest/api/content/{contentId}/history/{version}/macro/id/{local-id}

      and return their macro parameters.

      Actual Results

      • Top-level Forge inline macro: returns parameters as expected.
      • Nested Forge inline macro inside a Forge bodied macro: returns 404 Not Found, even though the macro exists in storage and has a valid local-id.
      • {
            "statusCode": 404,
            "data": {
                "authorized": true,
                "valid": true,
                "errors": [],
                "successful": true
            },
            "message": "com.atlassian.confluence.api.service.exceptions.api.NotFoundException: No macro found on content id : ContentId{id=11111111} with version: 0 and macroId: xxx-xxx-xxx-xxx-xxx"
        } 

      Workaround

      Fetch page storage via GET /wiki/rest/api/content/{contentId}?expand=body.storage.

      Parse the storage to locate the nested Forge macro’s ac:adf-extension / inline-extension node by parameters.local-id.

              Assignee:
              Unassigned
              Reporter:
              Sherica Ocbania
              Votes:
              11 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: