Haw to catch on change macro param in javascript?

Hello,
I am trying to get attachments for pages manually, because type:attachment doesn’t load attachment for page, so I have a macro with 2 params:
“dynamicContentMacros”: [
{
“key”: “my-macro”,
“name”: {
“value”: “my Macro”
},
“url”: “/macro?page={page}&spaceKey={space.key}”,
“description”: {
“value”: “Title”
},
“categories”: [“confluence-content”],
“outputType”: “block”,
“bodyType”: “none”,
“parameters”: [
{
“identifier”: “page”,
“name”: {
“value”: “Page”
},
“type”: “confluence-content”
},
{
“identifier”: “attachment”,
“name”: {
“value”: “Attachment”
},
“type”: “enum”
}
]
}
]
image
i want to catch on change page in javascript , because second param depends on the first


in my view.hbs i can’t get document.getElementById(“macro-param-page”);
can i create event on params or some thing else? i don’t find docs for this

thanks

Hi @souha,

The default macro editor is a bit limited in what it can do. If you want to introduce more complex functionality (like fields that depend on each other) you should look into implementing a custom macro editor: https://developer.atlassian.com/cloud/confluence/modules/macro-editor/

Hope this helps!

Cheers,
Sven

1 Like

Hi @sven.schatter, thank you for reply, I think also there is no way to do with the default macro, I will look haw to do with a macro editor

Thank you
Souha

1 Like