Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

SYNC Attachements between 2 tickets. MULTIPLICATION files issue for ticket B. AUTOMATION

Mateusz Janus
Contributor
February 28, 2026

Brothers & Sisters,

I see there is already a BUG in jira regarding SYNC comments with attachements but there is workaround proposal that I am trying to use.

SYNC attachements.jpg

 

Its simple logic taken from official atlassian web side.

1. When ticket is edited -> field Attachements

2. Issue type condition

3. For linked issues type XYZ

4. EDIT field Attachements -> Copy From trigger issue

5. Add a smart value comment

ISSUE OF THIS SOLUTION I AM FACING

1. I have Ticket A as a source of attachements

2. Ticket B that should copy attachements from Ticket A once they are uploaded to ticket A

In Other words, when Ticket A has new attachement copy it to Ticket B

BUT!!

1. This solution works only for 1 TIME sync.

2. If I upload Attach1 to Ticket A -> Attach1 is copied to Ticket B (PERFECT)

3. If I upload Attach2 to Ticket A -> Attach2 IS copied to Ticket B but also Attach1 is copied again

at the end of this Ticket A has 2 attachements and Ticket B has

Attach1 x2

Attach2 x1

If I upload Attach3 to ticket A then again Ticket B will take all of attachments AGAIN + Attach3.

 

Ticket B does not recognise "NEW ATTACHEMNT" from Ticket A.

I believe its common issue and i am wondering if it is feasible to resolve with automation only....

2 answers

1 accepted

0 votes
Answer accepted
Arkadiusz Wroblewski
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 Champions.
February 28, 2026

@Mateusz Janus 

That behavior is exactly what I’d expect from that setup.

The key point is: “Copy attachments from trigger issue” is not a delta-sync. It’s a full copy. Every time the rule runs, Jira just grabs everything from Ticket A and applies it to Ticket B again. Jira Automation doesn’t have the concept of “only the newly added attachment”, so Attach1 gets copied again when you add Attach2, then again when you add Attach3, etc. That’s why you end up with duplicates.

And you’re also right about the trigger problem: there isn’t a clean “Attachment added” trigger (especially in DC) that lets you reliably catch just the new file and act only on that one.

So if you want to solve it, you’re basically choosing between two realities:

 “Mirror mode” (automation-only, stable):

Before copying, delete attachments on Ticket B, then copy from Ticket A.

Result: no duplicates, but Ticket B becomes a mirror and you’ll wipe anything extra added directly to B.

“True sync” (only copy what’s new):

That needs scripting / app logic. You need something that can compare attachment lists and copy only the missing ones. Automation alone can’t really do that cleanly.

So short version: automation can mirror, but it can’t do real incremental attachment sync without duplication.

Mateusz Janus
Contributor
March 1, 2026

cześć @Arkadiusz Wroblewski 

thanks for response <3

"mirror mode" - so u suggest to add another action "remove all attachments" in ticket B and then "COPY ATTACHEMENTS" from ticket A ??? quite clever to be honest

"true sync" - i have scriptrunner but i am total NOOB with groovy and i can write only very simple scripts

Arkadiusz Wroblewski
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 Champions.
March 1, 2026

Cześć @Mateusz Janus  🙂

Yep for mirror mode that’s exactly what I mean, and it is kind of a clever hack in Cloud/DC terms:

Branch to Ticket B → remove attachments on B → then copy attachments from Ticket A.

Result: no duplicates, always clean. Only downside: Ticket B must be a “follower”  anything attached directly to B will get wiped on the next sync run.

For true sync: don’t stress about being a Groovy pro. You’re right, this is one of those cases where automation just can’t do “delta”, so ScriptRunner is the right tool. And the script logic is actually pretty simple conceptually:

read attachments on A

read attachments on B

compare (name/size is usually enough)

only upload what’s missing

Runned as Script Listener when conditions meet.

🤠

Mateusz Janus
Contributor
March 1, 2026

@Arkadiusz Wroblewski for quick win solution I shoose MIRROR remove all attach and upload again full list. Maybe one day Script Runner gonna be my new friend BUT NOT TODAY : D

The problem is... I am just checking list of available ACTIONS and I do not have action like "DELETE ALL ATTACHEMENTS"... so how to remove them?

Arkadiusz Wroblewski
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 Champions.
March 1, 2026

@Mateusz Janus 

Which DC Version you have?

Mateusz Janus
Contributor
March 1, 2026

@Arkadiusz Wroblewski  

  • (v9.12.1)

 

actions.png

Arkadiusz Wroblewski
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 Champions.
March 1, 2026

@Mateusz Janus 

Either your Automation Component is outdated or your user don't have sufficient permission in this Project for delete own and others attachments.

Like Mateusz Janus likes this
Mateusz Janus
Contributor
March 1, 2026

@Arkadiusz Wroblewski amazing.... you were right. I granted permission to AUTOMATION actor and there is !! Thank you !!! once day when I grow up I am gonna be like you!!

Like Arkadiusz Wroblewski likes this
Arkadiusz Wroblewski
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 Champions.
March 1, 2026

@Mateusz Janus 

Glad it worked.

Don’t exaggerate 🤣

If you think about it, it’s actually quite logical. If the user account you’re using doesn’t have the proper permissions to perform that action, then the automation won’t have that option either. That’s how layered permission schemes work, which is why automations should usually be created by a power user with sufficiently broad permissions.

0 votes
Florian Bonniec
Community Champion
February 28, 2026

Hi @Mateusz Janus 

 

I do not have a DC version on hand for now, but instead field change on attachment is there an event Attachment added instead ?

 

Regards

Mateusz Janus
Contributor
February 28, 2026

hi @Florian Bonniec i was thinking about same. Differente trigger but there is no dedicated trigger for attachements. :(

There is generic "issue updated" but dont know how to use this trigger tbh

triggers.jpg

Florian Bonniec
Community Champion
February 28, 2026

Nothing available in Multiple issue events too ?

Mateusz Janus
Contributor
March 1, 2026

@Florian Bonniec 

i do have multiple issue events. What is your idea regarding this trigger?

multi.jpg

Arkadiusz Wroblewski
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 Champions.
March 1, 2026

@Mateusz Janus @Florian Bonniec 

Biggest problem here that without ScriptRunner you can't put here intelligent delta logic and with Automation in this case only more less rebuild Logic. Limitation are in Copy Logic Not Trigger Logic.

Automation in DC:

Can copy attachments

Cannot compare attachment lists

Cannot identify “just added” attachment object

Cannot loop through attachment collections and evaluate differences.

Another trigger won't change here nothing.

If you don't have a problem to spend some Money then Backbone issue sync can do all work. ( If your use case us

I used it to synchronize tickets between DC and Cloud but working Cross Project too.

 

 

Like Mateusz Janus likes this

Suggest an answer

Log in or Sign up to answer