Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,298,401
Community Members
 
Community Events
165
Community Groups

Can I programmatically create a draw.io diagram in Confluence page?

Edited

Hi,

What I have for now : Confluence Cloud with the draw.io plugin.

What I try to achieve : I have a devops (CI/CD) pipeline that is working pretty well, but I want to document automatically the architecture of the application.

What I tried so far : I use the API rest of Confluence to create a new page and everything is working well. I also succeeded to create a CSV file that could be imported easily to create a diagram. I used a C# console application that I want to launch from my pipeline (this part is easy).

What is not working :

  1. Creation of the draw.io macro (the html is so cryptic for this macro)...
  2. Automation of the javascript sequence to use the CSV feature : Menu Arrange/Insert/Advanced/CSV... and the copy of the CSV in the textbox. I<m still thinking to use Selenium to automate the process. But I'm affraid that something will break in a future version...

Someone has an idea? Could I use an API or something else to achieve my goal?

Thank you!

 

2 answers

The format for the draw.io macro is Atlassian defined, but I think it's fairly standard for all macros. There's an ID in the macro, but I would try generating it without that parameter. If you create a drawio macro, it should be possible to reverse engineer it from the storage format of that page.

The second part we don't currently have, you would need to vote for https://trello.com/c/utXS2QU1/80-add-import-from-csv-directly-from-macro

0 votes
dcx45 I'm New Here May 09, 2022

Yes you can, see this example that deals with the encoding etc.  https://github.com/GanizaniSitara/drawio

Thank you! As soon as I have time, I will give it a try...

Manish I'm New Here May 21, 2022

@dcx45 Hi, Thanks for sharing your code but could you please share you data file template too (csv data template).

Suggest an answer

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

An update on Confluence Cloud customer feedback – June 2022

Hi everyone, We’re always looking at how to improve Confluence and customer feedback plays an important role in making sure we're investing in the areas that will bring the most value to the most c...

185 views 1 3
Read article

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