It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Link to a specific attachment version

Hi,

Confluence saves the page with a reference to an attachment, but no version:

<ac:link>
	<ri:attachment ri:filename="Attachment.pdf">
		<ri:page ri:content-title="Other Page"/>
	</ri:attachment>
	<ac:plain-text-link-body><![CDATA[Stuff]]></ac:plain-text-link-body>
</ac:link>

So this would always point to the most current version of the attachment.

I would like to point to a specific version (e.g. v2, even though there is a v5). Is there a solution for this?

Thank you in advance.

1 answer

Hello there!

First thing I would like to address is that in Confluence, we have two types of links:

  • Soft Links
  • Hard Links

Soft links are the links we insert using Confluence way of linking, the linking tool. Those links are automatically updated on Base URL change. This type of link works only for internal stuff.

Hard Links are links we refer using the URL address itself. Those links are what we are used to have all over the internet. We need to manually update them if something happen to the original address.

As you have noted Alex, the soft links do not refer to a specific version. They look straight into the latest.

To refer to a specific attachment version straight into a link, we could proceed like this:

  1. Go to the page in which the attachment is present
  2. Preview the attachment
  3. Open the download link in another tab
    1. It should look like this:
      1. http://youraddress:8090/download/attachments/983041/MyAttachment.png?version=3&modificationDate=1553524676608&api=v2&download=true
  4. Copy that link
  5. Change the version= parameter to the desired version
  6. Link that to your desired page

Notes:

  • This is a hard link, deleting the attachment version will cause a 404
  • You will need to update the link manually if needed
  • You can change download=true to preview=true so the download is not immediately triggered when a user clicks the link

Now, we can achieve something more polished if we use the Attachments Macro. However, this will show all attachment versions. What we need to check is that Include old attachment versions is checked before publishing the page.

Now, can I ask you something else? What is the objective of this link to an older version of an attachment in Confluence?

Maybe we can help you to create a more clean way of doing what you need to achieve!

Looking forward to your reply Alex!

 

Edit: if you need to look a little deeper into the Storage Format, you can take a look here:

Confluence Storage Format

Hi Diego,

Thank you for your detailed answer.

It's good to hear that there is a solution. Unfortunately, I don't think we can use this solution on a day to day basis for our users.

Background information

We work in a regulated environment where we follow FDA 21 CFR Part 11. According to the regulatory text, electronic records (in our case this would be an Confluence page) shall not be changed once they have been approved.

Now if we take as an example a page called "User Requirements Specification" v11 which includes a picture v1 and approve it with an Atlassian third-party add-on, this would make the page approved. If we then update the page "User Requirements Specification" to v12 and include picture v2, in the page history the page v11 would also point to picture v2. This would violate the integrity of the electronic record.

In the end the requirement would be that each page version points to specific attachment version. The only workaround at the moment is to change the filename each time, so there's only one version of each attachment.

Or is there another solution to this?

Did you find a solution to this?  It seems like a fairly fundamental issue even outside of medical regulatory requirements - because if you have a page with some images the page history no longer allows you to see what the page looked like at some previous point in time. 

We decided to restrict the upload of the same filename by a written procedure. The next step would be to disable or automatically rename uploads of files using an already uploaded filename with a custom add-on.

Not a really an ideal solution, but better than compromising data integrity.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

What project did you transition or start on Confluence with the shift to remote work?

It’s been great to hear from fellow users over the last few weeks about the best tips and fun moments you’ve had working on Confluence since the transition to working remote. I’d love to keep the c...

67 views 3 5
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you