# Historical attachment sync

**URL:** https://community.exalate.com/t/historical-attachment-sync/4290
**Category:** General Questions
**Tags:** onpremise-jira, migrated\_question
**Created:** [November 4, 2024, 6:45am UTC](https://community.exalate.com/t/historical-attachment-sync/4290 "2024-11-04T06:45:18Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)
#### Post date: [November 4, 2024, 6:45am UTC](https://community.exalate.com/t/historical-attachment-sync/4290/1 "2024-11-04T06:45:19Z")

</div>

_Originally asked by Nishant Sood on 23 July 2020 [(original question)](https://oldcommunity.exalate.com/questions/11340957)_

* * *

Hi Team,

I have two instance of JIRA one is on Private & the other one is Public. Whenever I am trying to sync historical attachments are not getting synced. Any new attachmet I am adding is getting synced but old attachments are not getting synced. Can you suggest some ways to do that or any rule that need to be added. Default rules are already there.Source: [Jira Server/Datacenter](https://oldcommunity.exalate.com/pages/viewpage.action?pageId=3703137)_(old community)_

* * *

#### Comments:

> **Nishant Sood commented on 29 July 2020**
>
> > Can someone please update on this if there is any solution.

> **Roman commented on 30 July 2020**
>
> > Hi Nishant Sood ,
> 
> Have you tried using the connect operation and use **Send all existing attachments** in advanced option [https://docs.idalko.com/exalate/display/ED/Connect+Operation](https://docs.idalko.com/exalate/display/ED/Connect+Operation) ?

> **Nishant Sood commented on 30 July 2020**
>
> > Hi Roman,
> 
> Yes I have tried it but it doesn’t work, I have not tried bulk connect as there are 400-500 issues.
> 
> Below are the rules.
> 
> **INCOMING Rule**
> 
> if(firstSync && replica.project.key == “TPE”){  
> issue.projectKey = “TPOHK”  
> issue.typeName = nodeHelper.getIssueType(replica.typeName)?.name ?: “Task”  
> }  
> if(firstSync && replica.project.key == “TPOHK”){  
> issue.projectKey = “TPE”  
> issue.typeName = nodeHelper.getIssueType(replica.typeName)?.name ?: “Task”  
> }  
> issue.summary = replica.summary  
> issue.description = replica.description  
> issue.labels = replica.labels  
> issue.comments = commentHelper.mergeComments(issue, replica)  
> issue.attachments = attachmentHelper.mergeAttachments(issue, replica) -_this also tried_  
> issue.attachments.addAll(replica.addedAttachments) - _this also tried_  
> // or issue.attachments += replica.addedAttachments  
> issue.components = replica.components  
> issue.created = replica.created  
> issue.updated = replica.updated  
> issue.resolutionDate = replica.resolutionDate  
> issue.affectedVersions = replica.affectedVersions  
> issue.fixVersions = replica.fixVersions  
> issue.originalEstimate = replica.originalEstimate  
> issue.remainingEstimate = replica.remainingEstimate  
> issue.timeSpent = replica.timeSpent  
> issue.environment = replica.environment  
> issue.status = replica.status  
> issue.resolution = replica.resolution  
> issue.type = replica.type  
> issue.priority = replica.priority
> 
> /\*  
> User Synchronization (Assignee/Reporter)
> 
> Set a Reporter/Assignee from the source side, if the user can’t be found set a default user  
> You can use this approach for custom fields of type User  
> def defaultUser = nodeHelper.getUserByEmail(“default@[idalko.com](http://idalko.com)”)  
> issue.reporter = nodeHelper.getUserByEmail(replica.reporter?.email) ?: defaultUser  
> issue.assignee = nodeHelper.getUserByEmail(replica.assignee?.email) ?: defaultUser  
> \*/
> 
> /\*  
> Comment Synchronization
> 
> Sync comments with the original author if the user exists in the local instance  
> Remove original Comments sync line if you are using this approach  
> issue.comments = commentHelper.mergeComments(issue, replica){ it.executor = nodeHelper.getUserByEmail(it.author?.email) }  
> \*/
> 
> /\*  
> Status Synchronization
> 
> Sync status according to the mapping [remote issue status: local issue status]  
> If statuses are the same on both sides don’t include them in the mapping  
> def statusMapping = [“Open”:“New”, “To Do”:“Backlog”]  
> def remoteStatusName = [replica.status.name](http://replica.status.name)  
> issue.setStatus(statusMapping[remoteStatusName] ?: remoteStatusName)  
> \*/
> 
> /\*  
> Custom Fields
> 
> This line will sync Text, Option(s), Number, Date, Organization, and Labels CFs  
> For other types of CF check documentation  
> issue.customFields.“CF Name”.value = replica.customFields.“CF Name”.value  
> \*/
> 
> -----------------------------------------------------------------------------------------------------------------------------------
> 
> **OUTGOING Rule**
> 
> replica.key = issue.key  
> replica.type = issue.type  
> replica.assignee = issue.assignee  
> replica.reporter = issue.reporter  
> replica.summary = issue.summary  
> replica.description = issue.description  
> replica.labels = issue.labels  
> replica.comments = issue.comments  
> replica.resolution = issue.resolution  
> replica.status = issue.status  
> replica.parentId = issue.parentId  
> replica.priority = issue.priority  
> replica.attachments = issue.attachments  
> replica.project = issue.project
> 
> //Comment these lines out if you are interested in sending the full list of versions and components of the source project.  
> replica.project.versions =   
> replica.project.components =
> 
> /\*  
> Custom Fields
> 
> replica.customFields.“CF Name” = issue.customFields.“CF Name”  
> \*/

---

<div class="post-metadata">

### Author: ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)
#### Post date: [November 4, 2024, 6:45am UTC](https://community.exalate.com/t/historical-attachment-sync/4290/2 "2024-11-04T06:45:20Z")

</div>

_Answer by Roman on 30 July 2020_

Nishant Sood I believe my colleague is already looking at this in EASE-5348 is that correct?

* * *

#### Comments:

> **Nishant Sood commented on 30 July 2020**
>
> > Yes. I have raised an issue too for this.
