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

Flavio Beck September 19, 2016

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

0 votes
David Benson _draw_io_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 20, 2016

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?

0 votes
Flavio Beck September 20, 2016

The new (copied) page becomes the first revision.

0 votes
David Benson _draw_io_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 20, 2016

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events