Cannot get page context in page preview and history views

We have a dynamic macro that relies on the container (page) information to render itself. When the macro is displayed in the preview view from the Confluence page editor or viewing a previous revision of a page, the page id we are given is some sort of draft id that results in a 404 error when we try to get the page information through /rest/api/content/. This happen if we pass in id as a context parameter and when we get the page context through navigator.location(). I have tried adding status=any and status=draft query parameters, but still doesn’t work. Is this a bug or expected behavior? If this is expected behavior, how can our add-on get the page information in these contexts?

2 Likes

I believe something similar has been reported that you may be interested in:
https://ecosystem.atlassian.net/browse/CE-943
https://ecosystem.atlassian.net/browse/CE-912
https://ecosystem.atlassian.net/browse/CE-13

Hi,

Any news on this issue?

Thanks
Monica

We have the same issue too. @acalantog, could you please contact the responsible persons to clarify this issue status ([CE-13] - Ecosystem Jira)?

Thanks,
Dmitry