Confluence-content does not retrieve the space

Hi,

I am writing a macro that needs a page from Confluence. I have this descriptor:

{
				"key": "my-macro",
				"name": {
					"value": "my Macro"
				},
				"url": "/macro?page={page}",
				"description": {
					"value": "macro sample"
				},
				"outputType": "block",
				"bodyType": "none",
				"parameters": [
					{
						"identifier": "page",
						"aliases": [],
						"name": {
							"value": "page"
						},
						"description": {
							"value": "Page to navigate when clicking the button"
						},
						"type": "confluence-content",
						"hidden": false,
						"required": true
					}
				]
			}

It retrieves mes as expected the page name that appears in the drop down menu in the page parameter when editing the macro but if the page is not from the same space as the current page it won’t retrieve the space so I am lost when the user adds a page from another space. In server it retrieves “{spaceKey}:{pageName}” in these cases but it doesn’t seem to do it in cloud.

How can I get the space (or better, get the selected page id)?

1 Like

Hi @ajdionisio,

This does sound like a bug or at least like an annoying difference to how it works on Server. I’m afraid though that this will not be changed short-term. So, as far as I can tell you have two options right now:

  • Add another parameter of type spacekey that your users have to fill if they want to reference a page from another space.
  • Implement a custom macro editor where you can have a custom page selector and store the page ID instead of the title.

Hope this helps!

Cheers,
Sven

2 Likes

Thanks, @sven.schatter. It looks like I will need to make a custom macro editor. Thanks for your help!

1 Like