How integrate linked jira issues to a confluence page

Hello,
I’m trying to replicate the link function below that’s permit to list Jira issues link to a confluence page.

image

In my case i want add in a confluence page something like a Jira macro based on pageid, for example. I use script-runner like this :
issueFunction in linkedIssuesOfRemote(“query”, “pageId=99195233”)
But the pageId has to be set by hand. Is possible to have automate the variable pageid to integrate id in a template ?

thx in advance