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.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Does ScriptRunner copy the page history, or does it flatten the history so the new page becomes the first revision?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.