The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Is there a way to refer to content id dynamically?

Maciej Kopa
September 12, 2022

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Jack Brickey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
September 12, 2022

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

Maciej Kopa
September 12, 2022

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?

Maciej Kopa
September 12, 2022

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

![](/wiki/download/attachments/<pageid>/image.png)
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events