Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

User Macros: $action in preview mode

Deleted user June 11, 2019

Hi,

I am working on an own user macro based on this source code: https://community.atlassian.com/t5/Answers-Developer-Questions/Get-incoming-links-with-in-a-user-macro/qaq-p/538128

It's working (I see the outout of the macro), when I use the macro and save the page including it. But in the preview mode, when editing the page, $action.getIncomingLinks() seem to be empty. Therefore the macro does not seem to be able to generate a preview.
When the part of the page with the macro gets included in another page via page properties report the part generated by the macro is empty, too.

Is there a way around this issue?

Cheers, Markus

2 answers

1 vote
scott July 19, 2019

I am running into the same issue.  After a little investigation, it looks like the $action variable's context is the calling page.  If you have any incoming links on the calling page, they will erroneously show up instead.  I believe the edit preview is technically a different page so the incoming links don't behave correctly.

Use can use this paid app

https://marketplace.atlassian.com/apps/166/linking-for-confluence?hosting=cloud&tab=overview

I believe it works correctly.

-Scott

0 votes
Deleted user July 23, 2019

Would it be possible to set the page regarding the incoming links as a parameter and to load this "incoming links" page (partially) via the parameter when parsing the calling page with the macro to get the incoming links of the "incoming links" page?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events