Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Broken link on page when copying the space

Hi there, 

I have a space with multiple pages. In the pages I have links to other pages in the same space. I had to copy the whole space. Now all links of the pages in the copied space refers to the pages in the old space. 

I want that the links would refer on the page in the copied space. 

I have thousands of pages with links in that space and to change those manually it would take a lot of time. Is there maybe a workaround? 

Thanks. 

2 answers

2 accepted

2 votes
Answer accepted
Helmy Ibrahim _Adaptavist_
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 Leaders.
Nov 02, 2023

Hi @Dominik Gashi

I am with the ScriptRunner Support Team.

Following up on @Andrii Maliuta's comment, we do have an example of a find-and-replace script that you can use with ScriptRunner to bulk update Confluence's page storage format.

Please find it here: https://www.scriptrunnerhq.com/inspiration/blog/find-and-replace-text-across-several-confluence-pages

From what I understand, the links in the target Space refer to the pages in the source Space. If that is the case, you would need to update the parameter value of ri:space-key from the source-space key, to the target-space key.

For reference, here is what the Confluence Link storage looks like:

<ac:link>
<
ri:page
ri:space-key="SPACEKEY"
ri:content-title="PAGE TITLE HERE"
/>
</ac:link>

Let me know if you have any further questions!

Kind Regards,
Helmy

Hi @Helmy Ibrahim _Adaptavist_ 

Thank you for following up Andrii's comment and for the detailed explanation. I could solve it with the ScriptRunner. 

Like # people like this
0 votes
Answer accepted
Andrii Maliuta
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 Leaders.
Oct 25, 2023 • edited

Hello @Dominik Gashi ,

Looks like you set those links as WEB links and not as Confluence Smart links

so it is treated as just href HTML text and after you move or copy the page it will remain static.

If you set links to Confluence pages/blogs/attachments as SMART links, it will adjust when renaming/copying/moving as needed.

You can change the links format using scripts or custom apps.addons.   

Hello @Andrii Maliuta , 

Thank you for your message and for your help! The links we are using are normal links that refer to a page on that space. When copying the whole space in refers still to the old page in the old space not in the copied page in the copied space. 

I think smart links are only available in Cloud. We are on Confluence Server. You mentioned that it's possible to change the links with apps. Do you know by change an app that can do that? 

Thanks. 

Andrii Maliuta
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 Leaders.
Oct 31, 2023 • edited

@Dominik Gashi 

the 2nd link I mentioned is for Server/Data Center (

)

Please check the Storage Format of the links on pages if it is simple 'a:href' or it is xHTML 'ac:link'. The Confluence wise links are of ac:link type.

Andrii Maliuta
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 Leaders.
Oct 31, 2023

>> You mentioned that it's possible to change the links with apps. Do you know by change an app that can do that

Yes, you just need to change the format of the link inside page body.

  • get pages with links
  • get pages bodies
  • replace href format with ac:link format
  • save changes on pages

For this you can use tools ScriptRunner with Java API or any HTP client and REST API.

Thank you @Andrii Maliuta !
I tested it out and it worked. 

Like Andrii Maliuta likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events