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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>> 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.
For this you can use tools ScriptRunner with Java API or any HTP client and REST API.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.