Macro input attachment parameter does not retrieve the attachments


I’ve tried to use the attachment parameter type in my dynamicContentMacros/staticContentMacros to accept attachments: "type": "attachment".

As described in the documentation Macro Input Parameter:

Currently, the following parameter types are supported in the macro browser’s UI: - attachment: displays an autocomplete field for search on attachment filenames.

As a result, I’ve got an empty drop-down element instead of autocomplete field and it doesn’t retrieve any page attachments. I’ve tried many variants to bring it to work, but it doesn’t show me anything.

What I already did:

  • Add two parameters: page - with “confluence-content” type for page selection and name - with “attachment” type

  • Used dynamicContentMacros and staticContentMacros modules - behavior was the same

  • Used almost the latest version of the AUI JS and CSS (8.5.1) with all.js script

  • I tried to find any additional information on input attachment parameter type usage in community, guides, tutorials, and examples.

The only way when it works is to use the following code below in the browser’s console after the page is loaded:

AJS.MacroBrowser.activateSmartFieldsAttachmentsOnPage("macro-name", ["json", "yaml"]);

But AJS.MacroBrowser is not available in the iframe scope of the macros, and I cannot find how I can include it in the macro’s scope.

There is a bug or I’m doing something wrong?


1 Like

@ alexvolsh Did you get anywhewre with this?

I’m having the exact same problem.

For reference, here’s some other places this problem is mentioned:

@david I did this by manual access to the attachments but you can try to add ACT_AS_USER to the atlassian-connect.json file in the scopes section. Let me know if this will work.

1 Like