Draw.io link points to a specific revision instead of latest one

Problem:

When I copy a space using ScriptRunner addon, it copies only the latest attachment (not all revisions) of course.

So, the original attachment revision 8, becomes revision 1 at the new space.

All pages using draw.io may become broken, because the page code refers to an specific revision

 

Example:

 

<p>

  <span style="color: rgb(0,0,128);"> <ac:structured-macro ac:macro-id="92098f28-c76b-4082-be20-d60a9dd03d25" ac:name="drawio" ac:schema-version="1">

      <ac:parameter ac:name="border">true</ac:parameter>

      <ac:parameter ac:name="viewerToolbar">true</ac:parameter>

      <ac:parameter ac:name="fitWindow">false</ac:parameter>

      <ac:parameter ac:name="diagramName">Test Page - Drawio diagram</ac:parameter>

      <ac:parameter ac:name="width"/>

      <ac:parameter ac:name="revision">8</ac:parameter>

      <ac:parameter ac:name=""/>

    </ac:structured-macro> </span>

</p>

 

In the example above, after copy the space, I need to edit all pages source code, and change to:

 

<p>

  <span style="color: rgb(0,0,128);"> <ac:structured-macro ac:macro-id="92098f28-c76b-4082-be20-d60a9dd03d25" ac:name="drawio" ac:schema-version="1">

      <ac:parameter ac:name="border">true</ac:parameter>

      <ac:parameter ac:name="viewerToolbar">true</ac:parameter>

      <ac:parameter ac:name="fitWindow">false</ac:parameter>

      <ac:parameter ac:name="diagramName">Test Page - Drawio diagram</ac:parameter>

      <ac:parameter ac:name="width"/>

      <ac:parameter ac:name="revision">1</ac:parameter>

      <ac:parameter ac:name=""/>

    </ac:structured-macro> </span>

</p>

 

Other attachments (PNG, DOCX, PDF, etc) does not have any problem.

3 answers

Does ScriptRunner copy the page history, or does it flatten the history so the new page becomes the first revision?

The new (copied) page becomes the first revision.

We've discussed this and don't think it's correct to show a different version to the version in the macro if the attempt to load that revision fails.

The reason is that this could easily mask a larger problem, we really should know why the revisions are not aligned (i.e. whatever causes the alignment problem should be fixed instead).

In terms of natively supported attachment types, Atlassian have additional control of responding to events, compared to add-ons. If you try Gliffy in the same test, for example, you'll find the revisions are also out of sync. For a standard, user-initiated page copy we can detect this and reset the macro, but our code doesn't trigger for the way ScriptRunner invokes a page copy.

I think the macro should be altered as part of the script, is this possible?

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 24, 2018 in Confluence

Atlassian Research opportunity with Confluence templates

Do you use templates with Confluence? Take part in a remote 1-hr workshop. You'll receive USD $100 for your time!   We're looking for people to participate in a   remote 1-hr workshop...

1,100 views 17 14
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you