Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,370,113
Community Members
 
Community Events
168
Community Groups

Is there a way to refer to content id dynamically?

Hi,

Let me explain. I have a page and I want to refer to this current page id in the text, but automatically. Let's say I write:

This page id is ${contentid}. 

 And the output in confluence when I publish is:

This page id is 12312312.

 

1 answer

0 votes
Jack Brickey Community Leader Sep 12, 2022

Hi @Maciej Kopa , so I am guessing Anchors do not work for you?

Hi, not really. It has to be only substituted. I'm using API to create a page with specific content, and it contains reference to current page that has to be changed. I found a workaround that created more problems for me - I have tried to create page, then fetch it (get id), substitute the "${pageid}" with actual page id, and update the page. Unfortunately, next time I run my app it automatically updates all pages that are different (and the ground truth is what I have on my local machine) therefore it changes the actual page id back to "${pageid}".  Also updating the file on my local machine is not an option, at least for now. Maybe you got any other idea worth trying?

Or maybe you know how to insert Markdown image without speechifying the current page id?

![](/wiki/download/attachments/<pageid>/image.png)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS

Atlassian Community Events