Originally asked by Samip K Banker on 02 October 2019 (original question)
We only want to sync images (mentioned in the description) when the sync happens from original to remote how can we achieve that?
Originally asked by Samip K Banker on 02 October 2019 (original question)
We only want to sync images (mentioned in the description) when the sync happens from original to remote how can we achieve that?
Answer by Francis Martens (Exalate) on 02 October 2019
Hi Samip K Banker
Assume the source is blue and the target red
In the outgoing sync of the blue, replace the
replica.attachments = issue.attachments
with the following statement
replica.attachments = issue.attachments.findAll { attachment ->
attachment.mimetype.startsWith("image/") &&
issue.description.contains(attachment.filename)
}
This will collect all the attachments of type image which are referenced in the issue description into the message sent from source to target
In the incoming sync of the red, ensure the following statement is executed
issue.attachments = attachmentHelper.mergeAttachments(issue, replica)
In the outgoing sync of the red, remove
replica.attachments = issue.attachments
In the incoming sync of the blue - remove the
issue.attachments = attachmentHelper.mergeAttachments(issue, replica)
Let me know
user-50445 :
I am looking to do somehting similar to this but just for Description…
https://docs.idalko.com/exalate/display/ED/How+to+filter+attachments+in+local+comments
~Samip
can you elaborate?
do you want the images referenced in the comments or in the description?
From Description (as the summary of the entry suggest). I looked at the documentation and I can only find how to do what I want to do for Comments… I want to see if you have any example to do it for Description.
Did you try the suggestion I made in this answer?
It is exactly that.
Sorry… I didn’t read your feedback proprely yesterday. Thanks. I will try it out.