Including files in PlantUML

David Roberts August 9, 2019

I want to include files stored in confluence in my PlantUML code.

I can include files from github: as in

@startuml

!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Container.puml

Container_Boundary('ll','lll')

@enduml

 

I have files loaded as attachments to pages. How do I find the URL??

The attachments page lists them, if I select and right click I get

 

https://<space>/wiki/download/attachments/1402339539/<file>?api=v2

 

I just want to link to the file ....

 

Thanks

 

 

1 answer

0 votes
Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 13, 2019

Hey David,

I think you've found how to get the address of the attachment already! Just as you noted, from the Attachments page you just right-click the attachment you want to link and copy the hyperlink.

image.png

You can strip the "?api=v2" from the end of the URL if the system you're trying to use expects to see .jpg or .png at the end of a URL. It's not required to display the file.

 

What you might be running into is a permissions problem. Confluence will protect your attachments from unauthorized users if the space/page are not set for anonymous access. PlantUML or another service trying to load that URL from an unauthenticated source might be hitting the login screen (and throwing an error because the login screen isn't an attachment). If you want to set the entire space as public, you can read about how to do that here. Setting the space (and subsequently, the individual page you're on) to public will allow any user/system to access the content without having to sign in.

Hope that helps explain things!
Daniel

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events